Jump to content

Backend [8] Undefined index: category error


estorde

Recommended Posts

Hi,

I have a Prestashop 1.7.5.0 installation, when I do try to edit the User Permissions at the Backend, I´m getting this error:

Notice en línea 199 en archivo /home/bnacdn3a/public_html/controllers/admin/AdminAccessController.php
[8] Undefined index: name

It´s a new installation and I do not modify the "AdminAccessController.php" file. In line 199 is writing:

return strnatcmp($a['name'], $b['name']);


197-    private function sortModuleByName($a, $b)
198-   {
199-        return strnatcmp($a['name'], $b['name']);
200-    }

Captura de pantalla 2019-01-21 a las 1.21.20.png

Link to comment
Share on other sites

  • 4 weeks later...

Exactly the same for me but in french:

Notice à la ligne 199 du fichier /vagrant/httpdocs/controllers/admin/AdminAccessController.php
[8] Undefined index: name

If, line 199 of AdminAccessController.php file  I do a

var_dump($a);

it seems some values doesn't have expected "name" attribute:

bug-profils.png.77a4bd15081f32400833b1dbe81c097d.png

So to fix warning tentatively, you can do:

if (isset($a['name']) && isset($b['name'])) {
    return strnatcmp($a['name'], $b['name']);
}

To know which module is, you can add into Module.php line 2643 (into getModulesAccessesByIdProfile method) before "return $roles" :

var_dump($roles);die();

It give me a list of modules with their permissions :

modules-permissions.png.d4f243b607c0ac0db78fce07a98d6d21.png

In my case, the two last ("ETRANSACTIONSEPAYMENT" and "MENUFOOTER") doesn't have a name or an id.

I tried reinstall them but it doesn't works better, so I deleted lines of ps_authorization_role table with the name of module into `slug` column and now.. it works like a charm !

But seems to be an old bug , I found another unsresolved topic from march 2017 here:

Edited by Klemart3D (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...