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.
This works fine in D7, but let's find out how to make this work for D8 too.
Comments
Comment #1
swentel CreditAttribution: swentel commentedTracking in #2057973: Don't add Edit module's data- attributes on pseudo fields (as used e.g. by Display Suite)
Comment #2
aspilicious CreditAttribution: aspilicious commentedHad a long talk with Wim about this...
We are kinda screwed... :)
Some notes before I foget:
1) Edit uses the field_name to generate the fancy popups
2) You can only have one! instance of the same field in the same entity. Let's say you have a tags field "field_tags" and lets say your new fancy ds field also have "field_tags" as named.
When that happens the edit js goes through the dom and picks the first instance. It ignores the second one so you can only edit the tags in the first field.
3) So smartass-me thinks, ok lets hide the "real" field_tags field in the display by setting it to hidden. When saving it gets 'removed' from the entity display. So when we visit the node you get a fatal js error.
Why?
Well, my custom field tries to fetch the "renderer" from the entityDisplay with name field_tags. As it is hidden now it can't be found resulting in a crash.
SO conslusion.
1) We can't add inline edit capabilities for fields that are hidden
2) We can't have multiple instances of the same field being inline edited
3) If you want to inline edit you probably need to write a formatter... (thats what wim suggests). I think we need to convert some of our custom fields to formatters in the end...
A lot of things to think about and discuss about.
Comment #3
aspilicious CreditAttribution: aspilicious commented