Just noticed the following workflow doesn't work as I was expecting it to using entity queues. I believe because the entity queues themselves are content entities.

Steps I followed:

1. Create a new entity queue.
2. Export configuration.
3. Deploy to production.
4. Delete entity queue from local environment.
5. Export configuration.
6. Deploy to production.

On step 6, you'll get the following (even if the entity queue is completely empty).

Entities exist of type <em class="placeholder">Entity subqueue</em> and <em class="placeholder">Entity queue</em> <em class="placeholder">queue_test</em>. These entities need to be deleted before importing.

This isn't a bug as such as the module is working as designed, but opening incase other people are running into this. It's annoying to have to delete the entity queues before deployment to each environment, would be better if they could be delete in this way IMO.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ThomWilhelm created an issue.

devkinetic’s picture

Ran into this today, so this is definitely an issue.

colan’s picture

This workaround might help:

drush @site eval '$entity_type = "entity_subqueue"; $storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type); $storage_handler->delete($storage_handler->loadMultiple(\Drupal::entityQuery($entity_type)->execute()));'
drush @site eval '$entity_type = "entity_queue"; $storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type); $storage_handler->delete($storage_handler->loadMultiple(\Drupal::entityQuery($entity_type)->execute()));'

OlgaS made their first commit to this issue’s fork.

OlgaS’s picture

If you run into this problem try this drush command to delete entity-subqueue before importing config.
It worked for me!
drush entity:delete entity_subqueue --bundle=your_entityqueue_machine_name

xamount’s picture

Just building on top of #5, if you are unable to run drush on a live environment, an alternative is to use a hook_update_N in a custom module:

function MODULENAME_update_N(&$sandbox) {
  /** @var \Consolidation\SiteAlias\SiteAliasManager $alias_manager */
  $alias_manager = Drush::service('site.alias.manager');
  $selfRecord = $alias_manager->getSelf();
  $your_queue = ['bundle' => 'YOUR_QUEUE_MACHINE_NAME'];
  Drush::processManager()->drush($selfRecord, 'entity:delete', ['entity_subqueue'], $your_queue)->mustRun();
}

Just ensure in your deployment that drush updb is fired before drush cim (which is usually the case).