Exclude entities that don't support UUIDs

Created on 8 August 2022, almost 2 years ago
Updated 5 February 2024, 5 months ago

Problem/Motivation

I am exporting all site content using drush dcdes. When I try to import I get the following error:

Warning: Undefined array key "uuid" in Drupal\default_content_deploy\Importer->preAddToImport() (line 431 of /var/www/html/dv20.openplus.ca/html/modules/contrib/default_content_deploy/src/Importer.php).

Warning: Trying to access array offset on value of type null in Drupal\default_content_deploy\Importer->preAddToImport() (line 431 of /var/www/html/dv20.openplus.ca/html/modules/contrib/default_content_deploy/src/Importer.php).

Warning: Trying to access array offset on value of type null in Drupal\default_content_deploy\Importer->preAddToImport() (line 431 of /var/www/html/dv20.openplus.ca/html/modules/contrib/default_content_deploy/src/Importer.php).

Entity type linkcheckerlink does not support UUIDs.

This is caused by the drupal/linkchecker module implementing an entity type that doesn't use UUID. If I look at EntityRepository.php, it checks if $entity_type->getKey('uuid') returns TRUE, if not it throws this error.

DCD should check if an entity supports UUID, and if not, exclude the entity type from the available list.

Steps to reproduce

Install and configure the drupal/linkchecker module, or any other module implementing an entity type that doesn't support UUIDs. Export the full site and try importing.

Proposed resolution

Check if entity types support UUID in DeployManager.php, getContentEntityTypes() method, before including in UI and exports.

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada smulvih2 Canada 🍁

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.

Production build 0.69.0 2024