- 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.
- 🇮🇳India divya.sejekan
Could not reproduce the issue . I tried reproducing Japan. But i can see both city and Prefecture .Here i have used city - tokyo , Prefecture - Tokyo. Attached image for reference
I have used D 11.1.8- , Address - 2.0.4
Steps :
1. Install Drupal , install module Address
2. Added Field Address( An entity field containing a postal address) for People / Account Setting
3. Created user - 🇯🇵Japan liuyuanchao
Hi @divya.sejekan, Thank you for your testing.
It seems like you didn't set the display format to plain.
The default display format is not problem. - 🇮🇳India divya.sejekan
Hi @liuyuanchao . Thank you for correcting me . Now im able to reproduce the issue by setting display to plain.
After applying patch - 3528487-city-wont-display MR!70 . Issue is resolved , Able to see the city now.
Tried with japan as well as other countries. Working as expected.
Patch gets applied cleanly.Steps Followed :
Steps :
1. Install Drupal , install module Address
2. Added Field Address( An entity field containing a postal address) for People / Account Setting . Set display - plain
3. Created userRTBC ++ . Keeping in review for further code review