Problem/Motivation
Just tried to set a taxonomy term field to non-required in the field UI, and the field persisted as required in the form.
This is because forum_form_node_form_alter() forces the widget to required regardless of the setting. The comment says for 'proper' forum modes, but this occurs for any node type using that vocabulary. The only way I was able to find out what this was happening was because I guessed there'd be an alter in forum module forcing the behaviour, but that was after a few minutes head scratching.
Proposed resolution
Remove the line setting the vocabulary to required to allow the field UI to work as expected.
Remaining tasks
Tagging novice because this should be a one-line patch.
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#6 | forum-module-8.8-removed-widget-required-and-comment.patch | 641 bytes | EmiliaC |
#2 | forum-module_8.8_remove-widget-required.patch | 639 bytes | EmiliaC |
Comments
Comment #2
EmiliaC CreditAttribution: EmiliaC at Softescu commentedI attached the patch where i removed the line making the widget required.
Please review the below, thank you!
Comment #3
EmiliaC CreditAttribution: EmiliaC at Softescu commentedComment #4
borisson_This patch does exactly what @catch asked. Thanks @EmiliaC!
Comment #5
catchI don't think this needs test coverage- we'd be testing the standard behaviour of the widget which is already tested.
One more thing to do here though, which is to remove the comment right above that line.
Comment #6
EmiliaC CreditAttribution: EmiliaC at Softescu commentedI have now removed the comment and added the patch.
Comment #7
borisson_I agree with #5 testcoverage doesn't seem to be needed here.
The comment is now removed as well, so that's good. Back to RTBC this goes.
Comment #8
plachIt's ok to do this since the node field instance is marked as required by default so we are preserving the previous behavior:
https://git.drupalcode.org/project/drupal/blob/e14126d6a8ddcce5ee35ebcd3...
Comment #9
plachCommitted 6483dcd and pushed to 8.8.x. Thanks!
Comment #11
plachGiven that this changes a form array, it's probably better to keep this 8.8.x only.