Conversation
…lers Part of phpmyadmin#17769. RemoveController passed $_POST['db'] straight to CentralColumns::deleteColumnsFromList(). Current::$database holds the same value, already validated by the DatabaseAndTableSetting middleware, and is what the sibling MakeConsistentController uses, so use it here too. The corresponding phpstan (argument.type) and psalm (PossiblyInvalidArgument, PossiblyInvalidCast) baseline entries are dropped with it. The three controllers also did unset($_POST['submit_mult']) before delegating to StructureController. That has been a no-op since the controllers switched to ServerRequest: the parsed body is a copy of $_POST taken once in ServerRequestFactory::fromGlobals(), and nothing in StructureController reads submit_mult from either source. RemoveControllerTest covers the changed line: DbiDummy only answers the exact central-columns SELECT and DELETE for db_name = 'test_db', so passing any other database fails the test. Instantiating the controller from a test also makes psalm's PossiblyUnusedMethod entry for its constructor obsolete, hence that baseline block goes too. Verification: phpcs clean on the changed files, phpstan reports no errors, psalm reports only the UnusedBaselineEntry on src/Utils/HttpRequest.php that is already present on master, phpunit tests/unit/Controllers/Database and tests/unit/Routing pass (67 tests, 210 assertions). Signed-off-by: Thomas André <thomandre@gmail.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| ])); | ||
| $_SESSION['tmpval'] = []; | ||
| $_SERVER['SCRIPT_NAME'] = 'index.php'; | ||
| $_REQUEST['db'] = Current::$database = 'test_db'; |
Contributor
There was a problem hiding this comment.
Do we need $_REQUEST['db'] in that case?
kamil-tekiela
approved these changes
Sep 8, 2026
| $_REQUEST['db'] = Current::$database = 'test_db'; | ||
|
|
||
| $dbiDummy = $this->createDbiDummy(); | ||
| // CentralColumns::deleteColumnsFromList() must target Current::$database |
Contributor
There was a problem hiding this comment.
Suggested change
| // CentralColumns::deleteColumnsFromList() must target Current::$database | |
| . " WHERE db_name = 'test_db' AND col_name IN ('id','name','datetimefield');", | ||
| true, | ||
| ); | ||
| // StructureController renders the database structure page afterwards |
Contributor
There was a problem hiding this comment.
Suggested change
| // StructureController renders the database structure page afterwards | |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #20478 +/- ##
============================================
- Coverage 63.96% 63.84% -0.13%
Complexity 16092 16092
============================================
Files 677 677
Lines 57844 57841 -3
============================================
- Hits 37000 36928 -72
- Misses 20844 20913 +69
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #17769.
Replaces the last
$_POSTaccess in the CentralColumns structure controllers.RemoveControllernow takes the database fromCurrent::$database, likeMakeConsistentControlleralready does. Theunset($_POST['submit_mult'])in the three controllers is removed: the parsed body is a copy of
$_POSTtaken in
ServerRequestFactory::fromGlobals(), andStructureControllerdoes not read
submit_mult, so it had no effect.Added
RemoveControllerTestto cover the changed line, and dropped thephpstan/psalm baseline entries that no longer apply.
Before submitting pull request, please review the following checklist:
Signed-off-byline as described in our DCO. This ensures that the work you're submitting is your own creation.