- Issue created by @douggreen
- Merge request !65Fix setting locality name/code when there is an admin area & add a test. β (Open) created by douggreen
- πΊπΈUnited States douggreen Winchester, VA
douggreen β changed the visibility of the branch 3497225-plain-text-formatter to hidden.
- πΊπΈUnited States douggreen Winchester, VA
douggreen β changed the visibility of the branch 3497225-plain-text-formatter to active.
- πΊπΈUnited States oheller
I can confirm that the above code returns $values as either a string or an array. We are overriding the template in our theme to access {{ locality.code }} which breaks when $values is a string. Attached is the patch removing the code.
- πΊπΈUnited States douggreen Winchester, VA
https://git.drupalcode.org/project/address/-/merge_requests/65 does the same as the attached patch, and adds test data.
- πΊπΈUnited States douggreen Winchester, VA
douggreen β changed the visibility of the branch 3497225-plain-text-formatter to hidden.
- π·π΄Romania oana.hulpoi
Thank you, @oheller!
The patch from #7 π Plain Text Formatter does not set Locality properly Active to remove the hasChildren() check in the AddressPlainFormatter resolves the issue.
I encountered this exact problem where address plain templates using {{ locality.code }} would break with the InvalidArgumentException. The fix ensures that locality data is consistently structured as an array with code/name keys.
I tested it with US addresses. - Status changed to Needs review
11 days ago 6:06pm 24 March 2025 - πΊπΈUnited States oheller
It looks good to me, but someone else should test and validate the change.