Skip to content

Commit 48e5845

Browse files
authored
N°8782 - Union queries allow all data (#807)
* 8782 - Union queries allow all data * N°8782 - Union queries allow all data
1 parent 454a1b2 commit 48e5845

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

core/dbunionsearch.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($aSearches)
5959
public function AllowAllData($bAllowAllData = true)
6060
{
6161
foreach ($this->aSearches as $oSearch) {
62-
$oSearch->AllowAllData();
62+
$oSearch->AllowAllData($bAllowAllData);
6363
}
6464
}
6565

tests/php-unit-tests/unitary-tests/core/DBUnionSearchTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,14 @@ public function SetSelectedClassesProvider()
183183
],
184184
];
185185
}
186+
187+
public function testAllowAllDataOnUnions()
188+
{
189+
$oSearch = \DBObjectSearch::FromOQL('SELECT Server UNION SELECT VirtualMachine');
190+
$oSearch->AllowAllData(false);
191+
self::assertFalse($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
192+
$oSearch->AllowAllData(true);
193+
self::assertTrue($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
194+
}
195+
186196
}

0 commit comments

Comments
 (0)