How to import addresses

Created on 27 November 2017, almost 7 years ago
Updated 2 May 2023, over 1 year ago

Is it already possible to import address data? If not this would be a great feature to have!

Feature request
Status

Needs review

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom vaccinemedia

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India saurabh-2k17

    Thanks @benkallos, for the patch. I have now ported it with the latest version of the module, using the same concept I have added the link field which can be now imported easily. The URI and Title will be added in the CSV using this format https://www.google.com|Google.

  • 🇮🇳India saurabh-2k17

    I noticed after using the module for some time that "administrative_area" field in the address was missed. Adding the updated patch with this field.

    Thanks

  • 🇮🇳India saurabh-2k17

    Apologies for not adding the interdiff.
    Thanks

  • 🇳🇱Netherlands Summit

    Hi,

    Is this correct?

    Shouldn't it not be:

    'country_code' => $address[0],
    'organization' => $address[1] ?? '',
    'given_name' => $address[2] ?? '',
    'family_name' => $address[3] ?? '',
    'address_line1' => $address[4] ?? '',
    'address_line2' => $address[5] ?? '',
    'postal_code' => $address[6] ?? '',
    'locality' => $address[7]?? '',
     'administrative_area' => $address[8] ?? '',
    

    Justasking?
    In the patch is twice the 'postal_code' => $address[6] ?? '', and 'locality' => $address[6] ?? '',

    greetings,

  • 🇮🇳India saurabh-2k17

    Hey @Summit

    Thanks for looking at the patch.

    - In the patch is twice the 'postal_code' => $address[6] ?? '', and 'locality' => $address[6] ??
    Please refer patch #12

    I am unsure why to do this, kindly explain.

    'locality' => $address[7]?? '',
    'administrative_area' => $address[8] ?? '',

    Are you sure this should go in the case 'address':
    'langcode' => 'en',

    There is a case 'langcode': here

  • 🇳🇱Netherlands Summit

    Hi,
    Still on patch #12 there is

    +                'postal_code' => $address[8] ?? '',
    

    So two times postal code, is that correct?

    Aha...langcode is already taken care for, and does not need to get from the address you explain?
    Or is it my mistake of interpretation?

    greetings and thanks for quick reply,

  • Assigned to saurabh-2k17
  • 🇮🇳India saurabh-2k17

    Hi @Summit, Apologies for the delay.

    - So two times postal code, is that correct?
    No, absolutely not, I have updated the patch and added an interdiff.

    - Aha...langcode is already taken care for, and does not need to get from the address you explain?
    Where is the field to store language in address field type? Do you see it?

    - And how to add this into the csv please? Just as a line of fields?
    You can download the sample csv file for your content type by visiting /admin/config/content/contentimport, once done you will find your address field too inside it. In my case its

    title,langcode,status,promote,body,field_address,...........
    Test Event,en,on,,Events Body,CA|Consensus|given_name|family_name|ABC Pintail Cr|North York|Toronto|ON|M3A 2Y7,.........

    you can put any random value or keep it blank if you have not enabled that field from the content type field settings. Like in my case I dont have "given_name" or "family_name" enabled.

  • 🇳🇱Netherlands Summit

    Hi,
    Thanks for the updated patch!
    Shouldn't the Sample CVS not also be changed when there is a Address-field in the Entity/content-type?
    Now it is only field_address what is showing?

    Thanks for the patch anyway!
    Greetings,

Production build 0.71.5 2024