Skip to content

Commit

Permalink
+ An isset check for the global $modx variable has been added to prev…
Browse files Browse the repository at this point in the history
…ent an error when calling the getFullTableName method.
  • Loading branch information
psthmn committed Dec 13, 2015
1 parent 0a0a8ba commit 4496dda
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modx.ddtools.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')){
Expand Down

0 comments on commit 4496dda

Please sign in to comment.