首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Joomla3.0菜单致命错误

Joomla3.0菜单致命错误
EN

Stack Overflow用户
提问于 2012-12-13 11:46:34
回答 1查看 1.4K关注 0票数 3

在尝试将菜单项添加到Joomla3.0后端的菜单后,由于重复别名访问后端菜单部分而失败的菜单项不再有效。菜单项从前面消失。尝试添加更多菜单项会导致致命错误。

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

删除数据库中的错误菜单项将返回前端菜单项,但后端仍然无法工作。

这是上面错误中突出显示的方法:**突出显示行

代码语言:javascript
复制
/**
 * 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: Notes:

  • 这是在本地主机上的IIS上进行的,用于开发。
  • 将内存限制设置为256 m和512 m,但没有改变。
  • 更改了PHP.ini中的其他几个时间/大小限制设置,但仍未更改joy
  • 重新启动服务器。
  • 不吃饼干
  • 重建的菜单和模块-修复前端显示-后端仍然损坏。

edit2:当前设置:

代码语言:javascript
复制
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: db行内容在#_menu表:

代码语言:javascript
复制
  '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:进一步发现:

例如,如果别名是“abc123”,则#_menu表中的每个其他记录的path字段都更新为an 123/现有别名,而路径在试图添加带有别名abc123的菜单项的新行上仍然是空的,则该行的id为0。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-03 14:13:52

显然,menu_type和菜单表中缺少主键,这导致了超时致命错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13859160

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档