Based on the change record https://www.drupal.org/node/2049309 user_access function calls needs to be changed to \Drupal::currentUser()->hasPermission()
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | change_user_access_calls-2457801-7-6.patch | 4.29 KB | andrew.mikhailov |
| #3 | change_user_access_calls-2457801-3.patch | 4.59 KB | hongpong |
| #1 | 2457801_change_user_access_calls.patch | 4.28 KB | gokulnk |
Comments
Comment #1
gokulnk commentedProviding a patch with the changes.
Comment #2
jaak commentedSimplytest.me says after enabling admin_menu module:
Fatal error: Call to undefined function current_path() in /home/se1b3739babe1cf5/www/sites/default/modules/admin_menu/admin_menu.module on line 153
Comment #3
hongpong commentedThis applies cleanly against current HEAD and seems to be essential to moving forward. @jaak to prevent the current_path() fatal error the path core module must be enabled. This has been noted on #2563867: PHP Fatal errors: Cannot instantiate interface Drupal\Core\Cache\CacheBackendInterface and others and also attached here is a re roll that fixes this fatal. I think it is RTBC so we can unravel some other fatal errors on other fronts.
Comment #4
dave reidFYI in D8 code you should always be using "\Drupal" and not just "Drupal" to indicate you're using the root namespace class. Also, you shouldn't RTBC your own patch, others should be doing that and reviewing & testing your patches.
Comment #5
hongpong commentedUgh I am really sorry about that, I got overcaffeinated and a bit frenzied from the fatals. Won't happen again :[
Comment #6
andrew.mikhailov commentedHello guys!
I corrected this patch, but I see you have many work with this module.
You didn't port variables, menu, config of module and etc.
Can I help you? I have enough time for contribute.
Best regards.
Comment #8
andrew.mikhailov commentedSorry don't understand what's problem...
I applied patch via git for last module version and for me it was correct.
Try again...
Comment #10
andrew.mikhailov commentedI've checked Drupal CI, I think problem on their side http://joxi.ru/Vrw3eBYCnMYWrX
Best regards.
Comment #11
andrew.mikhailov commentedComment #13
loopduplicate commentedChanging status back to needs review to see if the testbot is working now. This based on #10
Comment #16
yash_khandelwalBy replacing user_access function with Drupal::currentUser()->hasPermission method, issue resolved.
Comment #17
webel commentedI've tried updating using composer (on an active site) and also downloading and inspecting the tgz of the latest version from:
https://www.drupal.org/project/admin_menu/releases/8.x-3.x-dev
It (still) crashes vs Drupal 8.6.2, because it is still apparently riddled with user_access invocations:
At https://www.drupal.org/project/admin_menu it says:
I don't understand how anybody can possible be using this module vs Drupal8, I've not been able to use it for 2 years now, and it is also difficult to then uninstall with drush.
Comment #18
webel commentedUpdating to major (could even be critical) because crashes Drupal8 sites and very hard to then uninstall.
Comment #19
hongpong commented@webel admin_menu has been discontinued for Drupal 8 and replaced with a couple other helper modules. The maintainers are pretty firm about this.
Comment #20
thalles