From 4496dda72c94915da2083ddb5ae7d2ecb967890e Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 13 Dec 2015 14:42:45 +0500 Subject: [PATCH] + An isset check for the global $modx variable has been added to prevent an error when calling the getFullTableName method. --- modx.ddtools.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modx.ddtools.class.php b/modx.ddtools.class.php index a14b9ac..8f2902f 100644 --- a/modx.ddtools.class.php +++ b/modx.ddtools.class.php @@ -1307,9 +1307,11 @@ public static function generateRandomString($length = 8, $chars = 'abcdefghijklm } } -//Решение спорное, но делать Синглтон очень не хотелось -foreach (ddTools::$tables as $key => $val){ - ddTools::$tables[$key] = $modx->getFullTableName($key); +if(isset($modx)){ + //Решение спорное, но делать Синглтон очень не хотелось + foreach (ddTools::$tables as $key => $val){ + ddTools::$tables[$key] = $modx->getFullTableName($key); + } } if (method_exists($modx, 'getVersionData')){