Skip to content
Snippets Groups Projects
Commit 0d226686 authored by Mingsong Hu's avatar Mingsong Hu
Browse files

Fix submit function bug that prevents a taxonomy from saving while taxononmy plugin is disabled

parent cdbe269e
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,22 @@ class HmOverviewTerms extends OverviewTerms { ...@@ -87,7 +87,22 @@ class HmOverviewTerms extends OverviewTerms {
* The current state of the form. * The current state of the form.
*/ */
public function submitForm(array &$form, FormStateInterface $form_state) { public function submitForm(array &$form, FormStateInterface $form_state) {
// Override the form if the taxonomy hierarchy manager has been set up.
if ($config = \Drupal::config('hierarchy_manager.hmconfig')) {
if ($allowed_setup_plugins = $config->get('allowed_setup_plugins')) {
// If the taxonomy setup plugin is enabled,
// override the submitForm function.
if (!empty($allowed_setup_plugins['hm_setup_taxonomy'])) {
// We don't need to do anything here,
// as the taxonomy plugin take it over.
return;
}
}
}
// The taxonomy setup plugin is not enabled.
// Let the submitForm function from core handle this request.
return parent::submitForm($form, $form_state);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment