Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 6 лет назад
Родитель
Сommit
09593b2fb1

+ 2 - 7
modules/base/general/classes/BxBaseModGeneralDb.php

@@ -178,12 +178,7 @@ class BxBaseModGeneralDb extends BxDolModuleDb
     
     public function deleteNestedById ($iNestedId, $sTableKey, $sTableName)
 	{
-		return $this->query("DELETE FROM `" . $sTableName . "` WHERE `" . $sTableKey . "` = :item_id", array('item_id' => $iNestedId));
-	}
-	
-	public function getNested ($iContentId, $sTableKey, $sTableName) 
-	{
-		return $this->getAllWithKey("SELECT `" . $sTableName . "`.* FROM `" . $sTableName . "` WHERE `item_id` = :item_id", $sTableKey, array('item_id' => $iContentId));
+		return $this->query("DELETE FROM `" . $sTableName . "` WHERE `" . $sTableKey . "` = :item_id", array('content_id' => $iNestedId));
 	}
    
     function getNestedBy($aParams = array(), $sTableName)
@@ -205,7 +200,7 @@ class BxBaseModGeneralDb extends BxDolModuleDb
                 $aMethod['name'] = 'getAllWithKey';
                 $aMethod['params'][2]['id'] = (int)$aParams['id'];
                 $aMethod['params'][1] = $aParams['key_name'];
-                $sWhereClause .= " AND `" . $sTableName . "`.`item_id` = :id";
+                $sWhereClause .= " AND `" . $sTableName . "`.`content_id` = :id";
                 break;
         }
 

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralFormEntry.php

@@ -385,7 +385,7 @@ class BxBaseModGeneralFormEntry extends BxTemplFormView
                 if ($aInput['type'] == 'nested_form'){
 			        if (is_array($aInput['ghost_template']) && !isset($aInput['ghost_template']['inputs'])) {
 				        foreach ($aInput['ghost_template'] as $oFormNested) {
-					        $iNestedContentId = $oFormNested->insert(array('item_id' => $iContentId));
+					        $iNestedContentId = $oFormNested->insert(array('content_id' => $iContentId));
                             if ($aInput['rateable']){
                                 BxDolFormQuery::addFormField($this->id, $aInput['name'], $iContentId, $aValsToAdd[$CNF['FIELD_AUTHOR']], $this->_oModule->getName(), $iNestedContentId);
                             }

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -115,7 +115,7 @@ class BxBaseModGeneralModule extends BxDolModule
             return;
         }
         
-        $aContentInfo = $this->_oDb->getContentInfoById ($aNested['item_id']); 
+        $aContentInfo = $this->_oDb->getContentInfoById ($aNested['content_id']); 
         if (!$aContentInfo){
             echo _t('_sys_request_page_not_found_cpt');
             return;