Procházet zdrojové kódy

fixed bug in reinstall object create is instance sql fun

Piotr Labudda před 8 roky
rodič
revize
1196e4385e
2 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 0 1
      SE/se-lib/ACL.php
  2. 1 0
      SE/se-lib/Route/Storage.php

+ 0 - 1
SE/se-lib/ACL.php

@@ -465,7 +465,6 @@ class ACL {
 	public static function generateIsInstanceFunctionBody($namespace, $item = null) {
 	public static function generateIsInstanceFunctionBody($namespace, $item = null) {
 		if (!$item) $item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
 		if (!$item) $item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
 		if (!in_array( $item['_type'], [ 'AntAcl' ] )) return null;
 		if (!in_array( $item['_type'], [ 'AntAcl' ] )) return null;
-		$dbName = DB::getPDO()->getDatabaseName();
 		$sqlFunBody = " RETURN 1; ";
 		$sqlFunBody = " RETURN 1; ";
 		$localFieldsWithRestrictions = array_filter($item['field'], function ($field) {
 		$localFieldsWithRestrictions = array_filter($item['field'], function ($field) {
 			if (!$field['isLocal']) return false;
 			if (!$field['isLocal']) return false;

+ 1 - 0
SE/se-lib/Route/Storage.php

@@ -1606,6 +1606,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 			{
 			{
 				$item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
 				$item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
 				if ('AntAcl' === $item['_type']) {
 				if ('AntAcl' === $item['_type']) {
+					$dbName = DB::getPDO()->getDatabaseName();
 					$sqlFunBody = ACL::generateIsInstanceFunctionBody($namespace, $item);
 					$sqlFunBody = ACL::generateIsInstanceFunctionBody($namespace, $item);
 					DBG::nicePrint($sqlFunBody, "\$sqlFunBody");
 					DBG::nicePrint($sqlFunBody, "\$sqlFunBody");
 					DB::getPDO()->execSql(" DROP FUNCTION IF EXISTS `{$dbName}`.`isInstance_{$namespace}` ");
 					DB::getPDO()->execSql(" DROP FUNCTION IF EXISTS `{$dbName}`.`isInstance_{$namespace}` ");