Skip to content

Commit dfbd47d

Browse files
committed
Fix possibility pass query as string param in $ modx-> db-> getValue method, which was not documented in 1.4 but worked
1 parent 65c2454 commit dfbd47d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/Database.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ public function getTableName($table)
244244
public function getValue($result)
245245
{
246246
$out = false;
247+
248+
if(is_string($result)){
249+
$result = $this->query($result);
250+
}
251+
247252
if ($this->isResult($result)) {
248253
$result = $this->getRow($result, 'num');
249254
$out = is_array($result) && array_key_exists(0, $result) ? $result[0] : false;

0 commit comments

Comments
 (0)