- First commit to issue fork.
- @emilymathew opened merge request.
- 🇮🇳India emilymathew
Hi,
Thanks to @edisch. I love this feature of adding administrative area name token. It is really useful. The patch #9 worked for me only after adding additional brackets on the if condition. So I created a merge request based the on the patch in #9 with the tweak in if condition.
< if ( < $subdivision_code = $field_item->administrative_area < && $country_code = $field_item->country_code < ) { --- > if ( > ($subdivision_code = $field_item->administrative_area) > && ($country_code = $field_item->country_code) > ) {
See https://git.drupalcode.org/project/address/-/merge_requests/24.patch.
I hope this will be useful for anyone who require the same feature.
Thank you.
- 🇮🇳India emilymathew
Hi,
For some countries administrative area(state/province) is a text field, not a select list (eg: American Samoa). In that case, fetching administrative area name from subdivision code will not work.
I am uploading a patch to handle this case in addition to the fix mentioned in #14.
Please ignore the above merge request 24 and use this patch instead.
Thanks
- 🇨🇦Canada colan Toronto 🇨🇦
#15 works, but leaving as Needs Work because the code requires refactoring. That function is already unreadable (too long and too much nesting), and this patch makes that worse. Here's what I'd recommend:
- Create a new service.
- Jump into a service call directly from the hook implementation (to get out of procedural coding).
- Break it up into various protected methods so that they're short with descriptive names so that we have readable clean code with little or no nesting.
- Status changed to Needs review
over 1 year ago 8:48pm 12 May 2023 - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - 🇨🇦Canada colan Toronto 🇨🇦
Here's a more recent patch for Composer, which comes from the MR.
- last update
over 1 year ago 30 pass - @colan opened merge request.
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 30 pass - last update
over 1 year ago 30 pass - last update
11 months ago 41 pass - 🇦🇷Argentina tguerineau
Hi,
I'm providing an updated patch. This update is necessary due to the evolution of the 2.0.x branch since the last patch submission.
Context and Rationale:
The previous patch
address-token_for_administrative_area-3112487-25.patch
and the associated Merge Request were based on an older state of the 2.0.x branch. As a result, they could not be applied to the current branch due to significant changes that have occurred since then.
To address this, I manually applied the changes from the old patch to the latest version of the 2.0.x branch and created a new patch reflecting these updates.Manual Testing:
- Conducted thorough testing of the new
administrative_area_name
token. This included:
Integrating the token[node:field_address:administrative_area_name]
into the default meta tags for content descriptions. - Verifying token functionality on a node page with an address field.
- Confirming the token's presence and correct description in the token list at
/admin/help/token
.
- Conducted thorough testing of the new
- 🇧🇷Brazil rcsilvadev São Paulo, Brazil
Same as above, except this is a patch for version 2.0.0.
- 🇧🇷Brazil rcsilvadev São Paulo, Brazil
Please disregard my comment above. Patch #26 works fine with version 2.0.0.