Resolves #3576222: Disable DraftCleanup by default.

Closes #3576222

Steps to test

  • Pull the branch
  • On a existing site, run drush updb. Confirm the update 10001 for conductor is being executed.
  • Add $config['conductor.settings']['delete_unlinked_drafts_after'] = 1; to your settings.local.php.
  • Go to /admin/config/services/conductor and confirm the new check "Draft Cleanup" is unchecked.
  • Create a new draft (following the Additional info instructions)
  • Truncate the conductor_draft_map table
  • Confirm that the draft in conductor is not deleted
  • Now enable the Draft Clean up
  • Run cron
  • Confirm that the draft in conductor is now deleted.

Additional info

To confirm it works properly, the easiest way is to add a die() (or a breakpoint) in the ConductorHttpApiClient::deleteDraft method. The process to trigger the Draft deletion is a cron, written in ConductorHooks::cron The way to create an orphaned draft is to:

  • Open the Conductor Extension
  • Go through all the process and generate Title, for example. You can confirm the creation in conductor.com
  • Then go to admin/content/pages and delete the entity.
  • Then run cron Handy command to see all drafts associated locally: ddev drush sqlq "SELECT * FROM conductor_draft_map;"
Edited by Ignacio Sánchez Holgueras

Merge request reports

Loading