2012-12-13 65 views
3

嘗試將菜單項添加到Joomla 3.0的後端菜單中,該菜單由於訪問後端菜單部分的重複別名失敗而失敗,不再有效。 菜單項從前端消失。 試圖致命錯誤Joomla 3.0菜單致命錯誤

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36324 bytes) in \libraries\joomla\table\nested.php on line 1251 

刪除數據庫中的錯誤菜單項添加更多的菜單項結果返回前端的菜單項,但後端仍不能正常工作。

這是上面的錯誤強調法:用* *突出的行

/** 
* Method to recursively rebuild the whole nested set tree. 
* 
* @param integer $parentId The root of the tree to rebuild. 
* @param integer $leftId The left id to start with in building the tree. 
* @param integer $level  The level to assign to the current nodes. 
* @param string $path  The path to the current nodes. 
* 
* @return integer 1 + value of root rgt on success, false on failure 
* 
* @link http://docs.joomla.org/JTableNested/rebuild 
* @since 11.1 
* @throws RuntimeException on database error. 
*/ 
public function rebuild($parentId = null, $leftId = 0, $level = 0, $path = '') 
{ 
    // If no parent is provided, try to find it. 
    if ($parentId === null) 
    { 
     // Get the root item. 
     $parentId = $this->getRootId(); 
     if ($parentId === false) 
     { 
      return false; 
     } 
    } 

    // Build the structure of the recursive query. 
    if (!isset($this->_cache['rebuild.sql'])) 
    { 
     $query = $this->_db->getQuery(true); 
     $query->select($this->_tbl_key . ', alias') 
      ->from($this->_tbl) 
      ->where('parent_id = %d'); 

     // If the table has an ordering field, use that for ordering. 
     if (property_exists($this, 'ordering')) 
     { 
      $query->order('parent_id, ordering, lft'); 
     } 
     else 
     { 
      $query->order('parent_id, lft'); 
     } 
     $this->_cache['rebuild.sql'] = (string) $query; 
    } 

    // Make a shortcut to database object. 

    // Assemble the query to find all children of this node. 
    $this->_db->setQuery(sprintf($this->_cache['rebuild.sql'], (int) $parentId)); 

    $children = $this->_db->loadObjectList(); 

    // The right value of this node is the left value + 1 
    $rightId = $leftId + 1; 

    // Execute this function recursively over all children 
    foreach ($children as $node) 
    { 
     /* 
     * $rightId is the current right value, which is incremented on recursion return. 
     * Increment the level for the children. 
     * Add this item's alias to the path (but avoid a leading /) 
     */ 
    **** 
     $rightId = $this->rebuild($node->{$this->_tbl_key}, $rightId, $level + 1, $path . (empty($path) ? '' : '/') . $node->alias); 
    **** 

     // If there is an update failure, return false to break out of the recursion. 
     if ($rightId === false) 
     { 
      return false; 
     } 
    } 

    // We've got the left value, and now that we've processed 
    // the children of this node we also know the right value. 
    $query = $this->_db->getQuery(true); 
    $query->update($this->_tbl) 
     ->set('lft = ' . (int) $leftId) 
     ->set('rgt = ' . (int) $rightId) 
     ->set('level = ' . (int) $level) 
     ->set('path = ' . $this->_db->quote($path)) 
     ->where($this->_tbl_key . ' = ' . (int) $parentId); 
    $this->_db->setQuery($query)->execute(); 

    // Return the right value of this node + 1. 
    return $rightId + 1; 
} 

沒有任何人有一個修復?

在方法細節中鏈接的文檔文章實際上並不存在。

EDIT1:注:

  • 這是IIS在本地主機上用於開發目的
  • 組內存限制爲256M和512米,但沒有改變。
  • 在PHP.ini中更改了其他幾個時間/大小限制設置,但仍然沒有快樂
  • 重新啓動服務器。
  • 沒有餅乾
  • 重建的菜單和模塊 - 修復前端顯示 - 後端仍然損壞。

EDIT2:當前設置:

max_execution_time: 3000 3000 
max_file_uploads: 200 200 
max_input_nesting_level 64 64 
max_input_time 600 600 
max_input_vars 1000 1000 
memory_limit -1 512M 

EDIT3:在#_menu表DB行內容:

'0', 'menutype', 'title', 'alias', '', '', '', 'separator', '1', '1', '1', '0', '0', '0000-00-00 00:00:00', '0', '1', '', '0', '{\"menu_image\":\"\",\"menu_text\":1}', '223', '224', '0', '*', '0' 

edit4:進一步發現:

我f例如別名是'abc123'#_menu表中的每一個其他記錄都將其路徑字段更新爲abc123/existing-alias,而路徑在通過嘗試添加具有別名abc123的菜單項添加的新行上保持空白,該行具有0

+0

你檢查的Joomla配置,看看有什麼內存限制設置它是什麼? – jprofitt

+0

關於joomla關於內存限制的配置沒有任何意見,請將php.ini重寫爲-1,如上所述。 – ChelseaStats

回答

0

ID顯然是主鍵從menu_type和菜單表丟失,這是造成超時 - 致命錯誤

+0

我有完全相同的錯誤,但主鍵確實存在。 –

+0

可能是一個愚蠢的評論,但字段/值在那裏,但他們設置爲您的數據庫中的主鍵字段? – ChelseaStats

+0

是的,它們被標記爲數據庫中的主鍵。 –