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.
Hey and thank you very much for this great module. Sadly we were running into an edge-case which lead to several hours bug searching...
Context:
Using semantic_fields in a custom view mode vs. default display.
Problem:
After disabling the custom view mode and using the default view mode again the semantic_fields settings from the custom view mode still apply (incorrectly!) and lead to confusion.
Solution:
Use field_view_mode_settings();
to check if the selected view mode is active, otherwise fall back to default!
See patch in #1.
Comment | File | Size | Author |
---|---|---|---|
#2 | semantic_fields-check_view_mode_custom_settings-2876627-1.patch | 1.1 KB | Anybody |
|
Comments
Comment #2
AnybodyPatch attached. We've tested it for our projects and it works great, solving the problems.
Comment #3
AnybodyComment #4
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedHey @Anybody, I had to adjust to this to prevent the notices:
(mostly just checking that $element['#view_mode'] was not null). I haven't tried to write this more efficiently, so marked it as "Needs work"
Comment #5
AnybodyHey @andileco, which kind of notices did you get? Could you create a patch?