Entityqueue usage
Last updated on
18 September 2025
If you want to synchronize entity queues between websites, the usage is not straight forward and some special handling is needed.
Some steps can't be included in Entity Share directly, others may be one day if people contribute to that.
- Ensure that before the first synchronization there is no subqueue entities on client websites:
- Entityqueue creates or update subqueue content entities when the entity queue config entity is saved. And it is not possible to have several entity subqueue referencing the same entity queue (at least for simple queue).
- So to avoid having different UUIDs between the remote and client websites, on the client website, after the entity queue config import creation happened, delete programmatically or with Drush the entity subqueues, example:
drush entity:delete entity_subqueue
- Create the following import plugin and configure it to be after/below the Default data processor in the PREPARE IMPORTABLE ENTITY DATA stage:
<?php
declare(strict_types = 1);
namespace Drupal\entity_share_custom\Plugin\EntityShareClient\Processor;
use Drupal\entity_share_client\RuntimeImportContext;
use Drupal\entity_share_client\ImportProcessor\ImportProcessorPluginBase;
/**
* Entity subqueue data processor.
*
* @ImportProcessor(
* id = "custom_entitysubqueue_data_processor",
* label = @Translation("Custom entity subqueue data processor"),
* description = @Translation("Custom entity subqueue JSON data preparation to have Entity Share import working."),
* stages = {
* "prepare_importable_entity_data" = -50,
* },
* locked = false,
* )
*/
class EntitySubqueDataProcessor extends ImportProcessorPluginBase {
/**
* {@inheritdoc}
*/
public function prepareImportableEntityData(RuntimeImportContext $runtime_import_context, array &$entity_json_data) {
$field_mappings = $runtime_import_context->getFieldMappings();
$parsed_type = explode('--', $entity_json_data['type']);
$entity_type_id = $parsed_type[0];
$entity_bundle = $parsed_type[1];
if ($entity_type_id != 'entity_subqueue') {
return;
}
$public_name_to_set = $field_mappings[$entity_type_id][$entity_bundle]['name'];
$entity_json_data['attributes'][$public_name_to_set] = $entity_bundle;
}
}- Import the whole subqueue channel instead to select the specific subqueue. In the case of simple entityqueue there will be only one content.
- There is an entitysubqueue issue with the JSON:API UUID filter:
- does not work:
/jsonapi/entity_subqueue/jobs?filter[uuid-filter][condition][path]=id&filter[uuid-filter][condition][operator]=IN&filter[uuid-filter][condition][value][0]=2538341b-5da1-4e02-8cd1-0cb1fde28af9 - works:
/jsonapi/entity_subqueue/jobs/2538341b-5da1-4e02-8cd1-0cb1fde28af9
- does not work:
- There is an entitysubqueue issue with the JSON:API UUID filter:
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion