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.
I would like to use the, provided by this module, field type Zone in an entity, and also being able to display this field.
However I do not see any field formatter for this field. Could you please add one?
Many thanks!
Comment | File | Size | Author |
---|---|---|---|
#7 | zone-formatter-2996527-2.patch | 7.31 KB | bojanz |
#2 | zone-formatter-2996527-2.patch | 7.31 KB | aheredia |
|
Comments
Comment #2
aheredia CreditAttribution: aheredia commentedAdded a default formatter
Comment #3
aheredia CreditAttribution: aheredia commentedComment #4
aheredia CreditAttribution: aheredia commentedComment #5
miksha CreditAttribution: miksha commentedAfter applying this patch I am not getting more warning messages, and field settings for allowed number of values is still set to 1 with no options to configure. But when I populate fields I can add multiple number of values, not just one. I did rebuild cache after applying the patch.
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedThe widget is address_zone_default, the field type is address zone, the formatter can't be zone_default, needs to also be prefixed with address_
Wrong class name in docblock.
Our other formatters call this method viewElement, let's do the same here. Also, let's pass a Zone object ($item->value).
You don't need the !empty.
We shouldn't abbreviate element names. "dependent_locality", not "dlocality",
Also, dependent_locality should come after locality, not before.
Let's use the "item" type and give each element an appropriate label.
Also, we're not printing the zone label.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedHere's an updated patch.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedLet's proceed. We can open follow-up issues for any other zone bugs.
Thanks, everyone.