Redundancy in italian list and Views problem

Created on 14 January 2024, 10 months ago
Updated 16 April 2024, 7 months ago

Problem/Motivation

Hello
I am testing the module for an Italian site, and I have encountered a redundancy and an error in Views

Redundancy
In the select list 'state/province' there are also all cities, which makes no sense as the city is then entered in the 'city' field.
The most sensible thing is to leave the regions in the select list (eg: Piedmont, Lombardy, Tuscany, etc). If one wants to indicate the province, one can do so in the 'city' field by specifying the abbreviation of the province as with postal mail. Eg: Campi Bisenzio (FI).
The end result would be:

Country: Italy
State/province/region (add 'region' in label, also useful for other states): Tuscany
City: Campi Bisenzio (FI)
Address: something 54
Postal code: 12345

Views
field_address:country_code' and 'field_address:state' don't work with Views, no search possible.

Simple Address might be functional for those who don't need all the verification that Address allows, but not being able to search with Views can be a big limitation.
Many thanks

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ’ฌ Support request
Status

Fixed

Version

1.0

Component

Miscellaneous

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @senzaesclusiva
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @senzaesclusiva does area structure of the Italy somehow different from the USA/CA ?
    For example we know the structure - it looks like:
    US:
    State > City
    State > Village
    State > Town
    CA:
    Province > City
    Province > Town
    ..
    Ukraine:
    Oblast > City
    Oblast > Village

    Any chance that it is different somehow?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

    Hi @dstorozhuk
    In essence there are two structures in Italy
    region->city
    province->city
    but the latter depends on the former as a correspondence. The complete one is
    region->province->town (small town, village, etc)

    If in the select list you give the option to enter either the province or the region (try to imagine a professional use for collecting traders in a trade sector), you will never be able to do a complete search by 'region' because someone will surely enter the province and it will not be found.

    It is as if there were additional administrative areas in Ukraine, each comprising several oblasts, and then the structure would be
    Something > oblast > city
    Somethingelse > oblast > city

    I don't know if I explained this well; if I didn't, let me know what is not clear

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @senzaesclusiva I see.
    So just to add some clarity about purpose of this module.
    This module is not for collecting shipping/delivery address information. It doesnโ€™t provide any validation on the entered address and itโ€™s structure.
    The module idea was to create a simplified version of the Address module, which exists as standalone project.
    This module can be used if you need collect address information for some non-strict cases.
    It simplifies the Country/Administrative area selection, but that all what it can as opposed to Address module, which add country-specific address structure, validation, etc.

    However, I have to check why you can see City in State/Province. Itโ€™s can be because of the error in code/source data, or some cities/admin arras intersecting by names.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

    Absolutely agree. I never imagined it as a replacement for Address, just an easier module to collect addresses where they are needed.
    It's just that when they become many and you have to do a search, each field must have homogeneous data.
    Unfortunately I don't have the technical skills to understand if there is some error code or conflict with some library.
    Keep in mind that I am testing on a D10.2.1 from scratch on Php 8.1.13, if that helps, and I have installed Admin Tollbar and Simple Address only by using Composer 2.6.6.

    Thank you very much for your interest

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    I guess the issue is that the state_province.json file contains Italian region names and Italian province names, but it uses the name of the main city for the latter. For example, where it says "state": "Brescia", it should say "state": "Province of Brescia". Brescia is a city, like Milan.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    According to the Wiki, https://en.m.wikipedia.org/wiki/Brescia is city and comune. And comune is an administrative division of Italy. https://en.m.wikipedia.org/wiki/Comune . Probably, that is why Brescia appears in state_province.json. BTW, state_province.json was taken from Address module.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

    The problem is that in many regions the main cities name the province itself. Brescia is both city and province.
    If one lived in Brescia would have to write
    Contry: Italy
    State/province: Brescia
    City: Brescia

    but one data item is missing, the (administrative) Region

    For that I find it more correct:
    Country: Italy
    State/province/region: Lombardia
    City: Brescia

    It is just a matter of changing the label and the admin telling the user how to fill in.
    What is certain is that the field 'State/provinces/region' should not contain both provinces and cities, it is confusing.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @apaderno , if you have some suggestions how to make more clear for the end user, keep it unified across the countries and not overcomplicate the module - i am open.
    From my side I know that it is totally fine to name Region Kiev, or Vinnitsa, and and on the use same name for the city.
    Probably some hook? For Administrative Division field?

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @senzaesclusiva you are talking about the field label.
    Ok, probably we can allow site owners to select how to label the Administrative Division field.
    Like State/Province or State/Province/Region.
    Or, probably even better - just allow to name that field according to particular site needs.
    So by default, it always State/Province, but then site admin can got change the label according to the site specific needs.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

    @dstorozhuk I would never dare to ask a developer to make major interventions on his own module.
    As I see it, I would just leave the possibility of renaming the label and leave only the regions in the select list.
    It is no big deal for the user to write the city (with the abbreviation of the province, if necessary) address and postcode.
    So a minimal thing that does not change anything on the whole setting.

    For the rest I would check the compatibility with Views, which I do not understand why only for those two fields (country, state/province, does not produce results)
    Simple Address is an excellent substitute for Address, for those who do not need to do all the checking that Address allows.

    Thanks for everything, if you can, and sorry to bother you
    A good evening

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    In Italy, city is just a title given to some comune from the President of the Italian Republic. Speaking of city of Brescia and comune of Brescia, there is no difference, since they both cover the same territory.

    I would rather do like senzaesclusiva suggested, and give as Italian administrative sub-divisions the regions, so for Brescia I would select Italy as country and Lombardy as "state."

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Using Brescia as example (as I live there), I would enter Italy, Lombardy, Brescia. I would not enter Italy, Lombardy, Province of Brescia, Brescia nor Italy, Lombardy, Comune of Brescia, Brescia.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @apaderno, I believe you agree with me that we can't adopt the module for Italy only and ignore other countries.
    The Address module also does not have Lombardy in province field. It has only "Brescia" in province.
    https://master-usbivelh0mploaxoplh13ac1evgwqctn.tugboatqa.com/node/add/a...

    @senzaesclusiva
    Check the latest dev version. It should have the ability to change the Label of the State/Province column to one that more reflects particular site needs.
    `composer require 'drupal/version_information:^1.0'`.

    The Views integration needs more work, since full country name and province are not stored in DB now. Probably, I just need to store the full country name and state name in DB to make searchable with exposed filters and context.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @goodboy - if you have time and will - it could be nice to provide that integration with Views for country name an state/province to make them searchable.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

    Many thanks @dstorozhuk, sorry for my two-day absence.
    This afternoon I will try the dev version
    Ps: "The Address module also does not have Lombardy in province field. It has only "Brescia" in province."
    - This is an "error" also in Address. Eg. Lombardy has 12 provinces. If you want to make a selection of the whole region you can still do it, but you have a query filter with 12 'and'.
    Some Address modules that add/complete data for a state (I tested the one for Germany) insert 'administrative zones' (or regions as we call them in Italy)
    I will let you know and thanks again

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly senzaesclusiva

    Hi @dstorozhuk
    tested the dev version. I would say it fits well with what I wanted to achieve.
    Thanks for everything

  • First commit to issue fork.
  • Merge request !2Resolve #3414590 "Redundancy in italian" โ†’ (Merged) created by goodboy
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine goodboy Kharkiv, Ukraine

    goodboy โ†’ changed the visibility of the branch 3414590-redundancy-in-italian to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine goodboy Kharkiv, Ukraine

    goodboy โ†’ changed the visibility of the branch 3414590-redundancy-in-italian to hidden.

  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine goodboy Kharkiv, Ukraine
  • Status changed to Needs work 9 months ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine Kostiantyn

    Just finished testing. The filtering works for all fields except for field_adress:state. When the checkbox "Display the State/Province name instead of the state code" is enabled, the filtering for this field doesn't function as expected. It searches based on codes like AO-CNN instead of the actual name (see screenshots), even though it displays the name. If this is not related to this issue, then it can be closed.

  • Pipeline finished with Skipped
    8 months ago
    #128068
  • Pipeline finished with Skipped
    8 months ago
    #128070
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ

    @Kostiantyn we can close that task and merge. I will open a separate issue for Search By State.

  • Status changed to Fixed 8 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada dstorozhuk Chicago ๐Ÿ‡บ๐Ÿ‡ธ, Toronto ๐Ÿ‡จ๐Ÿ‡ฆ, Kyiv ๐Ÿ‡บ๐Ÿ‡ฆ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024