Skip to content

Issue 3238195: Errors on Taxonomy overview terms when form data is overridden.

Milan Golubovic requested to merge issue/thunder-3238195:hierarchy-manager into 6.1.x

thunder_taxonomy_form_taxonomy_overview_terms_alter() is using $form['terms']['#header'] value without checking if it exist and if some other module removes that value php will throw a lot of warrning for accessing unexisting variable. One of examples is Hierarchy manager module (https://www.drupal.org/project/hierarchy_manager) so when it's installed on overview page of any taxonomy (/admin/structure/taxonomy/manage/my_taxonomy/overview) module shoots bunch of notices and warnings:

Notice: Undefined index: terms in thunder_taxonomy_form_taxonomy_overview_terms_alter() (line 27 of modules/contrib/thunder/thunder_taxonomy/thunder_taxonomy.module). Warning: array_slice() expects parameter 1 to be array, null given in thunder_taxonomy_form_taxonomy_overview_terms_alter() (line 27 of modules/contrib/thunder/thunder_taxonomy/thunder_taxonomy.module). Notice: Undefined index: terms in thunder_taxonomy_form_taxonomy_overview_terms_alter() (line 29 of modules/contrib/thunder/thunder_taxonomy/thunder_taxonomy.module). Warning: array_slice() expects parameter 1 to be array, null given in thunder_taxonomy_form_taxonomy_overview_terms_alter() (line 29 of modules/contrib/thunder/thunder_taxonomy/thunder_taxonomy.module). Warning: array_merge(): Expected parameter 1 to be an array, null given in thunder_taxonomy_form_taxonomy_overview_terms_alter() (line 29 of modules/contrib/thunder/thunder_taxonomy/thunder_taxonomy.module).

Edited by Milan Golubovic

Merge request reports