We can access System>User Role without further problems:

enter image description here

but when we get into any option, either the "Add new Role" or the users "Administrators" or "Dealer" we get this blank form:

enter image description here

instead of the one it should appear:

enter image description here

We get this error on the logs:

Notice: Undefined index: rolename in /vendor/magento/module-user/Controller/Adminhtml/User/Role/SaveRole.php on line 213

This is the function of the line 213:

The line 213 is the 1rst one inside the function: $this->_getSession()->setData(self::ROLE_EDIT_FORM_DATA_SESSION_KEY, ['rolename' => $data['rolename']]);

protected function saveDataToSessionAndRedirect($role, $data, $resultRedirect)
        $this->_getSession()->setData(self::ROLE_EDIT_FORM_DATA_SESSION_KEY, ['rolename' => $data['rolename']]);
        $this->_getSession()->setData(self::IN_ROLE_USER_FORM_DATA_SESSION_KEY, $data['in_role_user']);
        $this->_getSession()->setData(self::IN_ROLE_OLD_USER_FORM_DATA_SESSION_KEY, $data['in_role_user_old']);
        if ($data['all']) {
            $this->_getSession()->setData(self::RESOURCE_ALL_FORM_DATA_SESSION_KEY, $data['all']);
        } else {
            $resource = isset($data['resource']) ? $data['resource'] : [];
            $this->_getSession()->setData(self::RESOURCE_FORM_DATA_SESSION_KEY, $resource);
        $arguments = $role->getId() ? ['rid' => $role->getId()] : [];
        return $resultRedirect->setPath('*/*/editrole', $arguments);

I have run these commands:

rm -rf pub/static/*;
php bin/magento setup:upgrade;
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy; 
php bin/magento setup:static-content:deploy es_ES;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.