Problem/Motivation
The current implementation of Drush for the Webform module support Drush 8, 9, and 10. Support Drush 8 requires a backward compatibility layer which includes a WebformCliService and WebformCommandsBase with code generator command.
Removing the compatibility layer for Drush 8.x will make Drush much easier to support and maintain moving forward.
As stated here, Drush 10 is the recommend version for Drupal 8.4+ and Drush 9.x+.
Drupal 8 support will end in November 2, 2021
Proposed resolution
Only support Drupal 10 for Drupal 9.x+ and Webform 6.x+
Remaining tasks
- Update composer.json
- Remove backward compatibility layer
- Update WebformCommands.php
- Run test script
Detailed tasks
- Clean up WebformCommands doc blocks (remove DO NOT edit)
- Move all code from WebformCliService in WebformCommands
- Remove cliService from WebformCommands
- Remove WebformCliService.php and WebformCliServiceInterface.php
- Update drush.services.yml
- Move all code from WebformCommandBase into WebformCommand
- Remove WebformCommandsBase.php
- Remove /drush directory
- Run tests
Notes
- Goal is to merge WebformCommandsBase and WebformCliService into WebformCommands
- We may want to change everything to call $this->command and then change $this->comand to just $this
User interface changes
N/A
API changes
Removing Drush 8 support.
- Delete WebformCliService.php
- Delete WebformCommandsBase.php
- Delete webform_scheduled_email.drush.inc
- Delete WebformCommandsBase.php
Data model changes
N/A
Test Script
## Commands
drush list --filter=webform
x webform:composer:update (wfcu) Updates the Drupal installation's composer.json to include the Webform module's selected libraries as repositories.
x webform:devel:config:update (wfdcu, webform-devel-reset) Executes devel export config.
x webform:devel:reset (wfdr) Executes webform devel reset.
x webform:docs (wfd) Generates HTML documentation.
x webform:export (wfx) Exports webform submissions to a file.
x webform:generate (wfg) Create submissions in specified webform.
x webform:import (wfi) Imports webform submissions from a CSV file.
x webform:libraries:composer (wflc) Generates the Webform module's composer.json with libraries as repositories.
x webform:libraries:download (wfld) Download third party libraries required by the Webform module.
x webform:libraries:remove (wflr) Removes all downloaded third party libraries required by the Webform module.
x webform:libraries:status (wfls) Displays the status of third party libraries required by the Webform module.
x webform:remove:orphans (wfro) Removes orphaned submissions where the submission's webform was deleted.
x webform:repair (wfr) Makes sure all Webform admin configuration and webform settings are up-to-date.
x webform:scheduled-email:cron (wfsec) Executes cron task for webform scheduled emails.
x webform:tidy (wft) Tidy export webform configuration files.
## Developer tools
# Confirm that output list all update config files.
drush webform:devel:config:update
# Confirm that outout states 'Resetting message closed via *…'
drush webform:devel:reset
# Confirm that output states Documents generated to '/modules/sandbox/webform/html'.
drush webform:docs
# Confirm repair is execute
drush webform:repair
# Confirm schedule email cron is executed
drush webform:scheduled-email:cron
# Confirm YAML is tidied.
drush webform:tidy
## Composer
# Confirm that the website's composer.json file is update
drush webform:composer:update
## Libraries
# Confirm composer.json is generated
drush webform:libraries:composer
# Confirm that libraries are remove
drush webform:libraries:remove
# Confirm that libraries statuses is CDN
drush webform:libraries:status
# Confirm that libraries are download
drush webform:libraries:download
# Confirm that libraries statuses is Installed
drush webform:libraries:status
## Submissions
# Purge all contact submissions
drush -y webform:purge contact
# Generate 10 contact submissions
drush webform:generate contact 10
# Create a webform node and generate submissions
# @see /admin/structure/webform/manage/contact/references
drush webform:generate --entity-type=node --entity-id=16 contact 10
# Test invalidate source entity
drush webform:generate --entity-type=user --entity-id=1 contact 10
# Export all contact submissions
drush webform:export contact
# Export only contact webform node submissions
drush webform:export --entity-type=node --entity-id=16 contact
# Export latest 5 contact submissions
# THE BELOW COMMAND IS NOT WORKING AS EXPECTED.
drush webform:export --range-type=latest --range-latest=5 contact
# Export 10 contact submissions to a CSV file
drush webform:export --exporter=webform_submission_export_import contact > ~/contact.csv
cat ~/contact.csv
# Purge all contact submissions and confirm
drush -y webform:purge contact
drush webform:export contact
# Import all exported contact submissions in the CSV file
drush webform:import contact ~/contact.csv
# Confirm that there are now 10 restored submission
drush webform:export contact
drush webform:export --entity-type=node --entity-id=16 contact
# Confirm no orphaned submissions are found
drush webform:remove:orphans
Issue fork webform-3220309
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
Comment #2
jrockowitz commentedComment #3
jrockowitz commentedThis is a major refactor/reworking which I am going to assign to myself and aim to do the changes over the summer.
Comment #4
jrockowitz commentedThis change will require us to move from Webform 6.0.x to Webform 6.1.x.
Comment #5
jrockowitz commentedComment #6
idebr commentedComment #7
jrockowitz commentedComment #8
jrockowitz commentedComment #9
jrockowitz commentedComment #10
jrockowitz commentedComment #11
jrockowitz commentedI have tested the changes manually twice.
Comment #13
jrockowitz commentedComment #15
jrockowitz commented