Delete entity queue using configuration

Created on 25 March 2019, almost 6 years ago
Updated 27 November 2024, about 2 months ago

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.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia thomwilhelm Sydney

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.

  • 🇹🇹Trinidad and Tobago xamount

    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).

Production build 0.71.5 2024