Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Both Recipe and Article have a field_tags for tagging content with terms from the Tags vocabulary. The field on articles is set to create referenced entities if they don't already exist, whereas the field on recipes is not.
There is no reason for this inconsistency.
Proposed resolution
Set field_tags on recipe to create referenced entities if they don't already exist.
Remaining tasks
All the things.
User interface changes
Users will be able to free tag recipes.
API changes
None.
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#3 | 2992380_3_auto_create_recipe_tags.patch | 564 bytes | Eli-T |
Comments
Comment #2
Eli-TComment #3
Eli-TSorry, previous patch is empty.
Comment #5
JayKandari#3 Applies perfectly and the "Tags" field in Recipe content type is set to "create referenced entities if they don't already exist " - works good. 👍
However, I have a question about "field_recipe_category" && "field_author" fields of recipe content type. The latter one we can ignore as of now as it is being removed in #2991473: Remove the field_author from Umami recipe content type. The field "field_recipe_category" is also set to "auto_create: false".
Can we also make this inconsistency addressed for other entity referenced fields as well?
Comment #6
Eli-TThanks for taking a look @jaykandari!
With respect to Recipe Category, I don't think it's a given that we should auto create terms in that vocabulary. It makes sense to have a fixed set of categories rather than define them on them on the fly as you would do for a tags vocabulary which is potentially far more wide ranging.
Maybe changing the widget would be more appropriate, but I would put that in another issue.
Comment #7
JayKandari#6 makes sense as to why not auto-create recipe category. Thanks, @eli-t.
Marking it as RTBC.
Comment #10
lauriiiCommitted 6803dcc and pushed to 8.7.x. Also, cherry-picked 65c5eba and pushed to 8.6.x. Thanks! 🚀
Comment #11
lauriiiSaved the commit-credit