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.
In the install file there is an update hook that has a typo on $definition
here foreach ($node_info['bundles'] as $type => $defintiion)
.
This is the full hook_update_N().
/**
* Create buttons for all node types.
*/
function command_buttons_update_7002() {
$node_info = entity_get_info('node');
foreach ($node_info['bundles'] as $type => $defintiion) {
command_buttons_create_node_button($type, $definition['label']);
}
}
This effects the command button title when the command button is created as $label
will be NULL in command_buttons_create_node_button($type, $label)
.
I will create a patch that just adds the same update hook again with the correct spelling.
Comment | File | Size | Author |
---|---|---|---|
#1 | command_buttons-typo-2447497-1.patch | 580 bytes | scottalan |
Comments
Comment #1
scottalan CreditAttribution: scottalan commentedHere's a patch.
Comment #2
scottalan CreditAttribution: scottalan commentedComment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #4
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedthis is an issue and the patch fixes it.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedWhile the patch does work, shouldn't the original issue misspelling in 7002 be fixed also?
The update number needs to be increased
Comment #6
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThis patch totally worked for me. I had 54 pages of 'Add files' as command buttons.
Now I do not.
Comment #8
mpotter CreditAttribution: mpotter at Phase2 commentedCommitted to 48767c2.
I also updated the hook number and commented out 7002 because of typo (but left in for code history)