Fix case where tables from wrong db is loaded in navigation

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2024-02-29 15:53:59 -03:00
parent 9e7890e566
commit 0048963013
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
3 changed files with 16 additions and 2 deletions

View File

@ -68,6 +68,7 @@ phpMyAdmin - ChangeLog
- issue #17363 Fix duplicate route parameter after logging in
- issue #15670 Fix case where the data is truncated after changing a longtext column's collation
- issue #18865 Fix missing text-nowrap for timestamps columns
- issue #19022 Fix case where tables from wrong database is loaded in navigation tree
5.2.1 (2023-02-07)
- issue #17522 Fix case where the routes cache file is invalid

View File

@ -178,13 +178,13 @@ class Node
{
if ($realName) {
foreach ($this->children as $child) {
if ($child->realName == $name) {
if ($child->realName === $name) {
return $child;
}
}
} else {
foreach ($this->children as $child) {
if ($child->name == $name && $child->isNew === false) {
if ($child->name === $name && $child->isNew === false) {
return $child;
}
}

View File

@ -76,6 +76,19 @@ class NodeTest extends AbstractTestCase
);
}
public function testGetChild(): void
{
$parent = NodeFactory::getInstance('Node', 'parent');
$childOne = NodeFactory::getInstance('Node', '0');
$childTwo = NodeFactory::getInstance('Node', '00');
$parent->addChild($childOne);
$parent->addChild($childTwo);
self::assertSame($childTwo, $parent->getChild('00'));
self::assertSame($childOne, $parent->getChild('0'));
self::assertSame($childTwo, $parent->getChild('00', true));
self::assertSame($childOne, $parent->getChild('0', true));
}
/**
* SetUp for hasChildren
*/