Entityqueue entity fails to import

Created on 4 October 2024, 3 months ago

Problem/Motivation

After exporting an entityqueue and trying to import it on another site tome:import fails with a database error

[error] Drupal\Core\Database\IntegrityConstraintViolationException:
SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a
default value: INSERT INTO "entity_subqueue" ("revision_id", "queue",
"uuid", "langcode") VALUES (:db_insert_placeholder_0,
:db_insert_placeholder_1, :db_insert_placeholder_2,
:db_insert_placeholder_3); Array
(
[:db_insert_placeholder_0] =>
[:db_insert_placeholder_1] => alumni
[:db_insert_placeholder_2] => cbd4523b-7178-4755-8935-708bec8026ac
[:db_insert_placeholder_3] => en
)
in
Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionEx
ception() (line 45 of
/builds/rogerpfaff/redacted/web/core/modules/mysql/src/Driver/Database/mys
ql/ExceptionHandler.php).

The database has the name field but it is not addressed in the query. At which point is the field name missing in the entityqueue module for the export/import to not have that?

πŸ’¬ Support request
Status

Active

Version

1.12

Component

Tome Sync

Created by

πŸ‡©πŸ‡ͺGermany rogerpfaff Munich

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

Comments & Activities

  • Issue created by @rogerpfaff
  • πŸ‡©πŸ‡ͺGermany rogerpfaff Munich
  • πŸ‡©πŸ‡ͺGermany rogerpfaff Munich

    A look into the entity definition of the entityqueue module shows in src/Entity/EntitySubqueue.php

    entity_keys = {
     *     "id" = "name",
     *     "revision" = "revision_id",
     *     "bundle" = "queue",
     *     "label" = "title",
     *     "langcode" = "langcode",
     *     "uuid" = "uuid",
     *     "owner" = "uid",
     *     "published" = "status",
     *   },
    

    I think this is where the break happens. Should entityqueue module adapt this or tome handle it?

  • πŸ‡©πŸ‡ͺGermany rogerpfaff Munich

    The exported JSON export

    {
        "uuid": [
            {
                "value": "cbd4523b-7178-4755-8935-708bec8026ac"
            }
        ],
        "langcode": [
            {
                "value": "en"
            }
        ],
        "queue": [
            {
                "target_id": "alumni",
                "target_type": "entity_queue",
                "target_uuid": "77e98bfc-6d0c-431e-9728-e1e65efe941d"
            }
        ],
        "revision_created": [
            {
                "value": "2024-10-01T11:45:35+00:00",
                "format": "Y-m-d\\TH:i:sP"
            }
        ],
        "revision_user": [
            {
                "target_type": "user",
                "target_uuid": "b3698473-8910-4907-93b4-1936c0a80cb8"
            }
        ],
        "revision_log_message": [],
        "status": [
            {
                "value": true
            }
        ],
        "uid": [
            {
                "target_type": "user",
                "target_uuid": "b3698473-8910-4907-93b4-1936c0a80cb8"
            }
        ],
        "title": [
            {
                "value": "Alumni"
            }
        ],
        "items": [
            {
                "target_type": "node",
                "target_uuid": "91b4f754-a630-48a0-9127-d1340062ed29"
            },
            {
                "target_type": "node",
                "target_uuid": "54da8024-9ae9-48a9-98bc-b65f85ba2a02"
            },
            {
                "target_type": "node",
                "target_uuid": "22d6986f-49aa-44bd-a1aa-140c43081e7d"
            },
            {
                "target_type": "node",
                "target_uuid": "1cabb8a5-4daf-4c39-a841-e31dfe3144a3"
            },
            {
                "target_type": "node",
                "target_uuid": "cdc111ee-f835-4151-99dd-508b88e69baa"
            },
            {
                "target_type": "node",
                "target_uuid": "f9919b22-8442-4e35-ac46-50823267bd70"
            },
            {
                "target_type": "node",
                "target_uuid": "3b7b1684-d6dc-4816-af1d-4ba222c818aa"
            },
            {
                "target_type": "node",
                "target_uuid": "2cc0416e-601c-4411-b9ab-331d152fb142"
            },
            {
                "target_type": "node",
                "target_uuid": "a600f102-bd16-4d1f-a41c-dfd9b7ef926d"
            },
            {
                "target_type": "node",
                "target_uuid": "a218ac8c-8f40-4f34-a8c2-4e5a5c19499d"
            },
            {
                "target_type": "node",
                "target_uuid": "f33e10b7-45b4-4774-9b47-79fb929e56c4"
            },
            {
                "target_type": "node",
                "target_uuid": "119199dc-c42d-4428-8473-2513c238cc07"
            },
            {
                "target_type": "node",
                "target_uuid": "f3496a5e-7739-4014-b195-58069ba0fbf2"
            },
            {
                "target_type": "node",
                "target_uuid": "088c429b-a9d3-4b3b-8f8f-24ab2bf7c7b8"
            },
            {
                "target_type": "node",
                "target_uuid": "7b4eb5ed-a871-4a3d-9cd3-a83fecb8ae25"
            },
            {
                "target_type": "node",
                "target_uuid": "a0726807-7c2e-4f7a-beaf-d587d1074adb"
            },
            {
                "target_type": "node",
                "target_uuid": "8c8e8682-b14e-4c01-9c09-82500d79849a"
            },
            {
                "target_type": "node",
                "target_uuid": "b5d17bf1-b6a9-4a6e-ae82-81583755dfaa"
            },
            {
                "target_type": "node",
                "target_uuid": "8c584233-d4a8-4cc9-ac66-67f3b5f41d60"
            },
            {
                "target_type": "node",
                "target_uuid": "3b9656e3-938d-4183-ace9-e56e201cbdac"
            }
        ],
        "created": [
            {
                "value": "2024-10-01T11:45:35+00:00",
                "format": "Y-m-d\\TH:i:sP"
            }
        ],
        "changed": [
            {
                "value": "2024-10-01T12:04:48+00:00",
                "format": "Y-m-d\\TH:i:sP"
            }
        ],
        "default_langcode": [
            {
                "value": true
            }
        ],
        "revision_translation_affected": [
            {
                "value": true
            }
        ]
    }
    

    There is no name field like in #3106819: Error while importing Node Queues in D8 β†’

  • πŸ‡ΊπŸ‡ΈUnited States jcandan

    I believe this is an Entityqueue β†’ issue. They created an entity_subqueue content entity, but opted to do something special with the ID by making it a machine name instead.

    Linked related πŸ› Machine name not set when using sub queue as an entity reference Active .

    I suggest closing this ticket in light of the above.

Production build 0.71.5 2024