- Issue created by @mlncn
- 🇺🇸United States mlncn Minneapolis, MN, USA
The reason this is getting applied when it is not expected is because the base form is a node form and so the condition
$form_state->getBuildInfo()['base_form_id'] ?? NULL) === 'node_form'
(line 375 of src/GinContentFormHelper.php) is evaluating to true.The reason we cannot opt out of it is because the
$form_ids_to_ignore
(line 335 of src/GinContentFormHelper.php) is hard-coded, with no alter hook.Given this is a pretty custom one-off case i'm not sure we should look more into automatically ensuring this does not apply when it might break things, but it seems that might be possible (check for edit_actions somewhere)?
- 🇺🇸United States mlncn Minneapolis, MN, USA
Ah but excluding the form means the buttons do not show up at all.
Seems that the modifying/placing and the removing should be handled in one spot.
- 🇺🇸United States mlncn Minneapolis, MN, USA
Changing this to a feature request, since as covered above we can avoid this error if we can exclude custom (but content-extending) forms from Gin's enhancement of content forms.
Note that the ability to exclude by route will not help because the check for base_form_id, while mixed in with the check for routes, is independent and if it returns true the enhancements get applied.
Also, even where restricting by route can work, the route as in the example is for all entities of a type, so for all nodes, not by content type, so in many cases definitely too broad.
Allowing the
$form_ids_to_ignore
variable to be modified by third-parties (the same way routes already can be, in the same method) seems a very straightforward improvement.Merge request forthcoming.
- Merge request !532Issue #3488050 by mlncn: Allow form IDs to be ignored from Gin content form enhancements → (Open) created by mlncn
- 🇩🇪Germany jurgenhaas Gottmadingen
@mlncn We're currently working on 📌 Improve sticky actions implementation Active and with the latest version of the MR!536 the javascript error in the IS should be gone. Would you mind giving that a try and letting us know if that's true?
If not, please help us to find out what's still wrong with that, as we need to iron that out before we start looking into
form_ids_to_ignore
androute_names
in the\Drupal\gin\GinContentFormHelper::isContentForm
.