3

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

データベース内の誤ったメニュー項目を削除すると、フロントエンド メニュー項目が返されますが、バックエンドはまだ機能していません。

これは、上記のエラーで強調表示されているメソッドです: with * * 行を強調表示しています

/**
 * 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: 注:

  • これは、開発目的で localhost の IIS にあります
  • メモリ制限を 256m と 512m に設定しましたが、変更はありません。
  • 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: さらなる発見:

たとえば、エイリアスが「abc123」の場合、#_menu テーブルの他のすべてのレコードのパス フィールドは abc123/existing-alias に更新されますが、エイリアス abc123 でメニュー項目を追加しようとして追加された新しい行でパスが空のままである場合、この行には0のID。

4

1 に答える 1

0

どうやら主キーが menu_type および menu テーブルから欠落しており、これがタイムアウトの原因でした - 致命的なエラー

于 2013-01-03T14:13:52.283 に答える