- Issue created by @bcurry
- 🇯🇵Japan liuyuanchao
liuyuanchao → changed the visibility of the branch 3528487-city-wont-display to hidden.
- 🇯🇵Japan liuyuanchao
I change the twig file to display the city in the case that `locality.code` not exists.
- 🇨🇦Canada bcurry
Thanks for your insights. I tried the 2.1.x-dev version and it did not work for me. Although, full disclosure, after I installed 2.1.x-dev, the version does not appear under Address at: web/admin/modules . I later tried to install 2.0.4 and the version number is still not shown, so I don't know what version I'm actually running anymore.
As a test, I also tried setting the country to Japan. Interestingly, if the country is Japan, you get a field for the City and a field for the Prefecture. In my case, it doesn't matter what City I type in. The user profile will always show the Prefecture twice and the City will not be shown. I assume it is showing the prefecture as the city in one of those cases.
Most of my testing as been with US and Canadian cities.
Something strange I've observed in the address-plain.html.twig is if I use
{{ locality.code }}
I don't get any errors, but I don't see the city. If I use:{{ locality }}
I get the following error:InvalidArgumentException: "code" is an invalid render array key. Value should be an array but got a string. in Drupal\Core\Render\Element::children() (line 97 of /Applications/MAMP/htdocs/content/web/core/lib/Drupal/Core/Render/Element.php).
It's counterintuitive to me that if I use ".code" in my twig file, there are no errors, if I take ".code" out of my twig file, I get an error citing "code".
- 🇯🇵Japan liuyuanchao
liuyuanchao → changed the visibility of the branch 3528487-city-wont-display to active.