Gave it a spin at simplytest.me and got this error upon enabling the module:

Fatal error: Cannot access protected property Drupal\Core\Session\UserSession::$uid in /www/sites/all/modules/admin_menu/admin_menu.module on line 232

Comments

dmouse’s picture

the global $user->uid has chanche for $user->id(); or $GLOBALS['user']->id();

dmouse’s picture

Status: Active » Needs review
StatusFileSize
new2.66 KB

patch

klonos’s picture

Gave it a go with and without the patch at simplytest.me. With the patch applied I got this lengthy error:

Warning: Invalid argument supplied for foreach() in _drupal_schema_initialize() (line 313 of core/includes/schema.inc).
Notice: Undefined index: fields in Drupal\Core\Database\Driver\mysql\Schema->createTableSql() (line 97 of core/lib/Drupal/Core/Database/Driver/mysql/Schema.php).
Warning: Invalid argument supplied for foreach() in Drupal\Core\Database\Driver\mysql\Schema->createTableSql() (line 97 of core/lib/Drupal/Core/Database/Driver/mysql/Schema.php).
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administra' at line 1: CREATE TABLE {cache_admin_menu} ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administration menu to store client-side cac'; Array ( ) in db_create_table() (line 590 of /home/s9a9c7424607c545/www/core/includes/database.inc).
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administra' at line 1: CREATE TABLE {cache_admin_menu} ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administration menu to store client-side cac'; Array ( ) in Drupal\Core\Database\Connection->query() (line 571 of core/lib/Drupal/Core/Database/Connection.php).
Notice: Use of undefined constant LANGUAGE_TYPE_INTERFACE - assumed 'LANGUAGE_TYPE_INTERFACE' in admin_menu_page_build() (line 247 of sites/default/modules/admin_menu/admin_menu.module).
Notice: Undefined property: Drupal\Core\Language\Language::$langcode in admin_menu_page_build() (line 247 of sites/default/modules/admin_menu/admin_menu.module).
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "cache.admin_menu". in Symfony\Component\DependencyInjection\Container->get() (line 289 of /home/s9a9c7424607c545/www/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).

After hitting the back button, I got this one:

Notice: Use of undefined constant LANGUAGE_TYPE_INTERFACE - assumed 'LANGUAGE_TYPE_INTERFACE' in admin_menu_page_build() (line 247 of sites/default/modules/admin_menu/admin_menu.module).
Notice: Undefined property: Drupal\Core\Language\Language::$langcode in admin_menu_page_build() (line 247 of sites/default/modules/admin_menu/admin_menu.module).
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "cache.admin_menu". in Symfony\Component\DependencyInjection\Container->get() (line 289 of /home/s9a9c7424607c545/www/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
dmouse’s picture

Yes, this issue is related https://drupal.org/node/1965552 but I dont have response

hass’s picture

Issue summary: View changes
Status: Needs review » Needs work

You need to load the user object and do not access it via GLOBAL.

$account = \Drupal::currentUser();
$account->id();
mas5d2’s picture

Status: Needs work » Needs review

Changed global $user to $user = \Drupal::currentUser() as per comment #5 and https://drupal.org/node/2032447.

Changed $user->uid to $user->id() in those cases.

mas5d2’s picture

Changed global $user to $user = \Drupal::currentUser() as per comment #5 and https://drupal.org/node/2032447.

Changed $user->uid to $user->id() in those cases.

klonos’s picture

I tried testing this over @ simplytest.me, but I got this error:

If you have just changed code (for example deployed a new module or moved an existing one) read http://drupal.org/documentation/rebuild

Additional uncaught exception thrown while handling exception.

Original

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administra' at line 1: CREATE TABLE {cache_admin_menu} ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administration menu to store client-side cac'; Array ( ) in Drupal\Core\Database\Connection->query() (line 569 of /home/s78b572205b99d66/www/core/lib/Drupal/Core/Database/Connection.php).

Additional

Exception: theme() may not be called until all modules are loaded. in theme() (line 522 of /home/s78b572205b99d66/www/core/includes/theme.inc).

klonos’s picture

mas5d2’s picture

Yup, that looks like another bug: https://drupal.org/node/2178861.

When enabling the module, it looks like it can't create the cache table or something.

It appears to enable despite the fatal error, and you can test the above patch.

mas5d2’s picture

Changed two more instances of $global user to Drupal::currentUser

mas5d2’s picture

https://drupal.org/node/1965552 looks like it may solve this issue as well.

klonos’s picture

It appears to enable despite the fatal error, and you can test the above patch.

Well I gave the new patch in #11 above and I did get the same error as in #8. I then tried switching to /admin to see if things work as you say, but all I got was a huge "The website has encountered an error. Please try again later." page with this:

    Warning: Invalid argument supplied for foreach() in _drupal_schema_initialize() (line 315 of core/includes/schema.inc).
    Notice: Undefined index: fields in Drupal\Core\Database\Driver\mysql\Schema->createTableSql() (line 96 of core/lib/Drupal/Core/Database/Driver/mysql/Schema.php).
    Warning: Invalid argument supplied for foreach() in Drupal\Core\Database\Driver\mysql\Schema->createTableSql() (line 96 of core/lib/Drupal/Core/Database/Driver/mysql/Schema.php).
    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administra' at line 1: CREATE TABLE {cache_admin_menu} ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administration menu to store client-side cac'; Array ( ) in db_create_table() (line 599 of /home/sfc1cb44235d67b9/www/core/includes/database.inc).
    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administra' at line 1: CREATE TABLE {cache_admin_menu} ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Cache table for Administration menu to store client-side cac'; Array ( ) in Drupal\Core\Database\Connection->query() (line 569 of core/lib/Drupal/Core/Database/Connection.php).
    Notice: Use of undefined constant LANGUAGE_TYPE_INTERFACE - assumed 'LANGUAGE_TYPE_INTERFACE' in admin_menu_page_build() (line 248 of sites/default/modules/admin_menu/admin_menu.module).
    Notice: Undefined property: Drupal\Core\Language\Language::$langcode in admin_menu_page_build() (line 248 of sites/default/modules/admin_menu/admin_menu.module).
    Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "cache.admin_menu". in Symfony\Component\DependencyInjection\Container->get() (line 303 of /home/sfc1cb44235d67b9/www/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
klonos’s picture

...upon refreshing the same page, the error changed to this (only the last portion of the above error):

    Notice: Use of undefined constant LANGUAGE_TYPE_INTERFACE - assumed 'LANGUAGE_TYPE_INTERFACE' in admin_menu_page_build() (line 248 of sites/default/modules/admin_menu/admin_menu.module).
    Notice: Undefined property: Drupal\Core\Language\Language::$langcode in admin_menu_page_build() (line 248 of sites/default/modules/admin_menu/admin_menu.module).
    Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "cache.admin_menu". in Symfony\Component\DependencyInjection\Container->get() (line 303 of /home/sfc1cb44235d67b9/www/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
klonos’s picture

I also tried a combination of the patch in #11 together with #1965552-21: Convert service registration to YAML, but that fails to apply over @ simplytest.me.

I'll give it another go if someone provides instructions of the patches required to make it work.

klonos’s picture

Filed #2181387: 8.x modules not downloaded/installed when selected as an additional project. for the issues I've been having over at simplytest.me with admin_menu 8.x. Until that issue is resolved, I cannot find a way to apply multiple patches to admin_menu 8.x. Perhaps I'll setup a local environment and test but my time is limited currently (more than it already was) so I can't promise anything.

jibran’s picture

I have created a fork of admin_menu 8.x-3.x on github. Please help me fix it for Drupal 8
PRs are welcome. https://github.com/jibran/admin_menu

thalles’s picture

Category: Bug report » Support request

This module has been deprecated for Drupal 8.
For Drupal 8: the Admin Toolbar provides an experience similar to admin_menu with the core toolbar.

thalles’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.