Admin Menu Modif. Log Warning

Hi,

I changed admin menu for everyone except user 1 via my_changes as follows:

app/addons/my_changes_schemas/menu/menu.post.php

use \Tygh\Registry;

if ($_SESSION[‘auth’][‘user_id’] != 1) {

$schema = array(
‘central’ => array(
‘orders’ => array(
‘items’ => array(
‘view_orders’ => array(
‘href’ => ‘orders.manage’,
‘alt’ => ‘order_management’,
‘position’ => 100,
),
),
),
),
);

$schema[‘central’][‘orders’][‘items’][‘call_requests’] = array(
‘attrs’ => array(
‘class’ => ‘is-addon’
),
‘href’ => ‘call_requests.manage’,
‘position’ => 1000
);

}

return $schema;

It works fine, but I checked the logs and found following warning:

3837#0: *235810 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: top in /app/Tygh/BackendMenu.php on line 66
PHP message: PHP Warning: Invalid argument supplied for foreach() in /app/functions/fn.common.php on line 2625" while reading response header from upstream

What is wrong?

Try to add the following line of code

$schema['top'] = array();

before

return $schema;

Thank you.

Now it works perfect

Thank you.

Now it works perfect

You are welcome!