Allow for mapping Taxonomy items

Created on 21 December 2021, almost 3 years ago
Updated 8 April 2024, 8 months ago

Problem/Motivation

I'd like to map taxonomy items. Requires a tamper to find the specific taxonomy items. Taxonomy items are not provided for in the mapping list.

Steps to reproduce

Steps to reproduce
1. Install feeds para mapper
2. Change feeds_para_mapper.info.yml to support drupal 9 - core: 8.x => core_version_requirement: ^8.8 || ^9
3. Apply the patch feeds_para_mapper-error-getFieldDefinition-3244189-4.patch.txt
4. Attempt to start mapping fields

Proposed resolution

Taxonomy items appear in WrapperTarget as ConfigEntityReference rather than EntityRefernce because the Mapper class maps plugins differently to how it is done in feeds. e.g. FeedType class.

1. Use the feeds target service (no result difference)
2. Don't break when the first plugin match is found. The last selected item is supposed to be canonical.
3. Use a named array so that plugin matches are overwritten. This has the effect of removing the feature which allows for multiple plugins to generate _1 or _2 mapping options.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇦🇺Australia interlated

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.

  • 🇨🇦Canada liquidcms

    tried module from #12. it worked except watchdog flooded with warnings:

    Plugin book does not have a field_types key

  • 🇨🇦Canada liquidcms

    i removed the watchdog log that was flooding the logs and some other code that wasnt doing anything around there and although this does work it runs very very slowly. Importing 10 nodes with a type that has a single paragraph with maybe 30 fields on it takes about a minute per node. Not really workable when you have 1000s of records to import. I have been trying to see which loop is killing this but not sure yet.

  • 🇨🇦Canada liquidcms

    Coming back to this for a different project to give it a try but although the module from #12 appears to know that i have a paragraph; its unclear how this would be used. My CSV has a "cell" with the following format:

    value1a,value1b::value2a,value2b::value3a,value3b

    would this plugin work with this data? is there some other data format required?

    the only thing i can think of would be:

    tamper for para field A: explode(::), explode(,), select array value 0 (i recall i wrote a plugin to select specific array values)
    tamper for para field B: explode(::), explode(,), select array value 1

    seems unlikely but will give it a shot.

  • 🇷🇺Russia kazah

    Hello, @liquidcms!
    Look at my last post: https://www.drupal.org/project/feeds/issues/2978757#comment-15161715 Support importing content with referenced paragraphs Active

    You can modify it for your own easy.

  • 🇨🇷Costa Rica maxmendez

    Today I faced with the same requirement, i've reviewed #12 comment code and created an tested in my case of use and seems to work correctly.

    I think this code requiere to be improved or reviewed by one with more experience with feeds and this module code and behavior.

  • Status changed to Needs work 12 months ago
  • 🇷🇺Russia profwebsait

    Drupal 9.5.11 (php 8.1 or 8.2 ) patch #12 or #22 error 502 Bad Gateway.
    8.x-1.dev is not work
    8.x-1.1 is not work

  • 🇨🇷Costa Rica maxmendez

    A new version that removed a cron warning related with feeds book target plugin.

    @profwebsait did you use this patch in tandent with https://www.drupal.org/files/issues/2021-12-16/feeds_para_mapper-error-g...

  • 🇳🇱Netherlands andmor

    We have a content type where we use multiple different fields of the same paragraph type.
    In this case to be able to map to the different fields we need to replace the line $supported[$field->id()] = $field; by the original $supported[] = $field;

    $field->id() seems to be the same for all fields of the same paragraph type.

    This is on Drupal 10.2.5 using the latest patch

Production build 0.71.5 2024