Import error: Feeds item: This field can only contain one value

Created on 26 March 2024, 3 months ago
Updated 9 April 2024, 3 months ago

I have multiple old feeds enabled in a website that were used to migrate from Drupal 7. I just left them there.
Now I want to do a bulk update for node titles with a new feed. Just the node id and the new title.
Most items import correctly but about 30% reports an error that the import failed because the feeds_item field can only hold 1 value.

Why does this happen?

If I delete all old feeds and remove the feeds_item field from all entities, uninstall feeds and then re-install feeds and create the feed I need, it works fine.

πŸ’¬ Support request
Status

Fixed

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands ecvandenberg

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

Comments & Activities

  • Issue created by @ecvandenberg
  • Status changed to Fixed 3 months ago
  • πŸ‡³πŸ‡±Netherlands MegaChriz

    I think that you might have accidentally reversed a config update. In feeds_post_update_ensure_feeds_item_storage_config_cardinality_is_unlimited() the cardinality of all feeds_item fields were set to unlimited. This resulted into a change in all field.storage.*.feeds_item configuration items. But if you had done a config import after running database updates, then the change coming from that update got reversed.

    Solution:

    1. If you manage the config files in yml files, go through every field.storage.*.feeds_item.yml file and set 'cardinality' to -1.
    2. After that, do a config import.

    For example, field.storage.node.feeds_item.yml could then look like this:

    uuid: fca90d5d-2059-40ba-b99c-76b7ead03233
    langcode: nl
    status: true
    dependencies:
      module:
        - feeds
        - node
    id: node.feeds_item
    field_name: feeds_item
    entity_type: node
    type: feeds_item
    settings:
      target_type: feeds_feed
    module: feeds
    locked: false
    cardinality: -1
    translatable: false
    indexes: {  }
    persist_with_no_fields: false
    custom_storage: false
    

    Note: the same question has been asked recently in πŸ’¬ feeds_item this field cannot hold more than 1 values. Fixed .

  • πŸ‡³πŸ‡±Netherlands ecvandenberg

    MegaChriz, you are the best!
    That really makes sense. In the past I wasn't aware of this effect. And indeed I see the cardinality: 1 in the config files.
    That makes me think what else might be mixed up in my sites...

    Many thanks for your quick response.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024