Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Function update_manager_access()
in update.module
refers to update_menu()
which no longer exists.
Further, the description of this function describes it as an Access callback which was true when it was invoked from hook_menu() but has been replaced by src/Access/UpdateManagerAccessCheck.php
. Though not used as an access callback anymore, it is invoked directly in many places as an access helper function.
Also, update_manager_access()
clashes with hook_ENTITY_TYPE_access()
and therefore should be renamed to _update_manager_access()
and usages should be internalised to the update module.
Comment | File | Size | Author |
---|---|---|---|
#9 | drupal-cleanup_update-2551267-3.patch | 9.33 KB | Jeremy |
Comments
Comment #2
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedAttached patch removes reference to
update_menu
and better describes function as an access helper.Comment #3
albertski CreditAttribution: albertski as a volunteer commentedChange looks good and makes sense. Ran the patch without any issues.
Comment #5
mandar.harkare CreditAttribution: mandar.harkare as a volunteer and commentedAdding the same patch again.
Comment #6
albertski CreditAttribution: albertski as a volunteer commentedRe-ran patch again. Still looks good!
Comment #7
alexpottCan we also rename this method to
_update_manager_access
.update_manager_access
is in danger of clashing withhook_ENTITY_TYPE_access
if a module creates an entity type called manager. Also we should move some of the help text from system.module to the update module. system_help should only display the message when update module is not enabled. The update module should display the message when it is.Comment #8
alexpottAccess helper:
can be removed too.Comment #9
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedUpdated patch to address all feedback:
update_manager_access
to_update_manager_access
update_menu()
system.module
toupdate.module
Comment #10
albertski CreditAttribution: albertski as a volunteer commentedRan the patch without any issues.
Manually reviewed patch and everything looks good.
I grepped "update_manager_access" just to make sure no other module calls it and it looks like the migrate_drupal module calls it. I think it should be updated there too.
Comment #11
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedWhat you're seeing there is a Drupal 7 database dump -- it's not affected by this change.
Comment #12
albertski CreditAttribution: albertski as a volunteer commentedAhh got it! Okay so this patch is good.
Comment #13
alexpottComment #14
alexpottComment #15
alexpottComment #16
webchickLooks good. There is one module I'm aware of that calls this method http://cgit.drupalcode.org/upgrade_status/tree/upgrade_status.module#n46, so wrote a brief change notice for it.
Committed and pushed to 8.0.x. Thanks!