When trying to delete a taxonomy, the source code do not enter in the conditional of xmlsitemap_taxonomy_form_taxonomy_form_term_alter function.
In case of deletion, the $form['delete']['#type'] is not equals to 'value' but of 'hidden'.
After analysis, in case of deletion, the $form['delete']['#type'] exist and his value is done to 'value'
I propose to change
if ($form['name']['#type'] == 'value') {
// If this is the delete form, do not add our form elements.
return;
}
to
if ($form['delete']['#type'] == 'value') {
// If this is the delete form, do not add our form elements.
return;
}
Comments
Comment #2
pifagorComment #3
jyraya commentedHello
I did not reproduce the issue with a clean install of platform. The value of
$form['name']['#type']is still 'value'.Do you have a custom or contrib module that would change this value before passing in the xmlsitemap_taxonomy code?
In any case, I think the more secure way is follow the logic implemented in the taxonomy module because if we change the value of
$form['name']['#type'], there is nothing preventing to do so for$form['delete']['#type']; after all, only the '#value' is important for the process.In 'taxonomy.admin.inc', line 674 of
taxonomy_form_term(), to detect that we are in the delete confirm form case, the test is:Then, we should have the same logic in
xmlsitemap_taxonomy_form_taxonomy_form_term_alter():Other parameters can be changed but this one cannot without breaking the taxonomy term form.
I push here a patch in this direction.
Comment #4
avpaderno