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 a lot of other places, there is a check for (isset($settings['taxonomy_extras'])
, but not here.
I modified my line 293 to include the extra checks.
Old:
return user_access('reorder taxonomy nodes') && $settings['taxonomy_extras'][$term->vid]['nodes']['type'] == 'nodes_by_weight';
New:
return user_access('reorder taxonomy nodes') && isset($settings['taxonomy_extras']) && isset($settings['taxonomy_extras'][$term->vid]['nodes']['type']) && $settings['taxonomy_extras'][$term->vid]['nodes']['type'] == 'nodes_by_weight';
Comments
Comment #1
Rob Holmes CreditAttribution: Rob Holmes commentedThanks for the bug report Dale, much appreciated. Ill get this fixed today hopefully.
Comment #2
gregoryshearer CreditAttribution: gregoryshearer commentedThis issue is still persisting and I just found you need another isset check for empty term pages to fix similar error:
Notice: Undefined index: taxonomy_extras on line 498 of taxonomy_extras.module
Might be 497 if you did not do the fix listed above first.
Old:
'#markup' => isset($settings['taxonomy_extras']) ? $settings['taxonomy_extras'][$term->vid]['misc']['empty'] : 'none',
New:
'#markup' => isset($settings['taxonomy_extras']) && isset($settings['taxonomy_extras'][$term->vid]['misc']['empty']) ? $settings['taxonomy_extras'][$term->vid]['misc']['empty'] : 'none',
But this fix caused it to insert the word "none" onto the empty term pages. (Seems like another bug as I would expect the module's "No Results Text" setting to over ride this.) If you do not want this (or anything to display) you can hide it with this CSS.
If this module is being updated, a worthwhile tweak might be line 496 edited with a class to make it easy to hide in CSS more selectively like:
'#prefix' => '<p class="empty-term">',