diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libraries/classes/Navigation/NavigationTree.php | 4 | ||||
-rw-r--r-- | psalm-baseline.xml | 23 | ||||
-rw-r--r-- | templates/navigation/tree/database_select.twig | 5 |
4 files changed, 22 insertions, 11 deletions
@@ -133,6 +133,7 @@ phpMyAdmin - ChangeLog - issue #12753 Show table structure after adding a new column - issue Fix a PHP notice when logging out - issue #17090 Fix bbcode not rendered for error messages on setup +- issue #17198 Fix the database selection when the navigation tree is disabled 5.1.1 (2021-06-04) - issue #13325 Fixed created procedure shows up in triggers and events and vice-versa diff --git a/libraries/classes/Navigation/NavigationTree.php b/libraries/classes/Navigation/NavigationTree.php index 38d7402c4e..b790b4efcb 100644 --- a/libraries/classes/Navigation/NavigationTree.php +++ b/libraries/classes/Navigation/NavigationTree.php @@ -19,6 +19,7 @@ use PhpMyAdmin\RecentFavoriteTable; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\Url; +use PhpMyAdmin\Util; use function __; use function _ngettext; @@ -1255,12 +1256,15 @@ class NavigationTree $nodes = $this->renderNodes($children); + $databaseUrl = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'); + return $this->template->render('navigation/tree/database_select', [ 'quick_warp' => $quickWarp, 'list_navigator' => $listNavigator, 'server' => $GLOBALS['server'], 'options' => $options, 'nodes' => $nodes, + 'database_url' => $databaseUrl, ]); } diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 508ffcce29..88f1f47303 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<files psalm-version="4.12.0@e42bc4a23f67acba28a23bb09c348e2ff38a1d87"> +<files psalm-version="4.13.0@cd489407a0219b93cadd04d5aff9845a942f7e5d"> <file src="index.php"> <InvalidGlobal occurrences="1"> <code>global $route, $containerBuilder, $request;</code> @@ -574,13 +574,16 @@ <code>$path</code> <code>$path</code> </MixedArgument> + <MixedArgumentTypeCoercion occurrences="1"> + <code>$keys</code> + </MixedArgumentTypeCoercion> <MixedAssignment occurrences="6"> + <code>$keys[]</code> <code>$path</code> <code>$path</code> <code>$type</code> <code>$v</code> <code>$value</code> - <code>$value</code> </MixedAssignment> <MixedInferredReturnType occurrences="2"> <code>array</code> @@ -604,7 +607,8 @@ <code>$fieldsTypes</code> <code>$name</code> </PropertyNotSetInConstructor> - <UnevaluatedCode occurrences="1"> + <UnevaluatedCode occurrences="2"> + <code>return [];</code> <code>return [];</code> </UnevaluatedCode> </file> @@ -11574,10 +11578,6 @@ <PossiblyInvalidCast occurrences="1"> <code>$tables[$i][Import::TBL_NAME]</code> </PossiblyInvalidCast> - <RedundantConditionGivenDocblockType occurrences="2"> - <code>$xml</code> - <code>$xml</code> - </RedundantConditionGivenDocblockType> <UnusedVariable occurrences="1"> <code>$val3</code> </UnusedVariable> @@ -15110,13 +15110,20 @@ <MixedReturnStatement occurrences="1"> <code>$config->getCookie($name)</code> </MixedReturnStatement> - <PossiblyNullPropertyAssignmentValue occurrences="1"> + <PossiblyNullArrayOffset occurrences="1"> + <code>$this->themes</code> + </PossiblyNullArrayOffset> + <PossiblyNullPropertyAssignmentValue occurrences="2"> + <code>$theme</code> <code>null</code> </PossiblyNullPropertyAssignmentValue> <RedundantCastGivenDocblockType occurrences="2"> <code>(bool) $perServer</code> <code>(string) $this->theme->id</code> </RedundantCastGivenDocblockType> + <RedundantCondition occurrences="1"> + <code>$configThemeExists</code> + </RedundantCondition> <RedundantConditionGivenDocblockType occurrences="1"> <code>$this->theme !== null</code> </RedundantConditionGivenDocblockType> diff --git a/templates/navigation/tree/database_select.twig b/templates/navigation/tree/database_select.twig index 90f804be01..5c9597592e 100644 --- a/templates/navigation/tree/database_select.twig +++ b/templates/navigation/tree/database_select.twig @@ -4,11 +4,10 @@ {{ list_navigator|raw }} <div id="pma_navigation_db_select"> - <form action="{{ url('/') }}"> + <form action="{{ database_url }}" method="get"> {{ get_hidden_fields({'server': server}) }} - <select name="db" class="hide" id="navi_db_select"> - <option value="" dir="{{ text_dir }}">{% trans 'Databases' %}…</option> + <select name="db" class="hide" id="navi_db_select" aria-label="{% trans 'Databases' %}"> {% for option in options %} <option value="{{ option.name }}" title="{{ option.title }}" data-apath="{{ option.data.apath }}" |