Replace
- drush_log
- drush_print
- drush_shell_exec
- drush_shell_cd_and_exec
- drush_get_context
Test script
## 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
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | 3164855-6.x-29.patch | 21.2 KB | jrockowitz |
| #28 | 3164855-28.patch | 21.26 KB | jrockowitz |
| #28 | interdiff-3164855-27-28.txt | 12.23 KB | jrockowitz |
| #27 | 3164855-8.x-5.x-27.patch | 9.64 KB | jrockowitz |
| #23 | 3164855-23.patch | 9.58 KB | paulocs |
Comments
Comment #2
alexshipilov commentedplease review
Comment #3
jrockowitz commentedComment #4
jrockowitz commentedThanks for contributing the patch. I linked to some related issues which include additional deprecated functions.
Comment #5
jrockowitz commentedComment #6
paulocsReplaced deprecated
$drupal_root = $this->drush_get_context('DRUSH_DRUPAL_ROOT');Comment #7
ryan.ryan commentedI'm adding `drush_get_context` to the list, as it breaks `drush webform:composer:update`.
Comment #8
zipymonkey commentedRe-rolled the patch for the 6.0.0 release.
Comment #9
paulocsFor me it looks good!
Comment #10
jrockowitz commentedPatch for 8.x-5.x with Drush 9 support.
Comment #11
jrockowitz commentedWhen someone has the chance they should merge the patch from #3194753: Patch to remove drush 10 warning
It would be awesome if someone could review and test all the existing webform commands in Drush 10.x.
I am currently not using Drush 10.x and this seems like a reasonable task to delegatete
Comment #12
paulocsI found a problem when generating submissions.
Call to undefined function Drupal\webform\Plugin\DevelGenerate\drush_get_option()I didn't have time to create a patch yet, but it has a problem.
Comment #13
Pooja Ganjage commentedHi,
Creating a patch as suggested in #12 comment.
Please review the patch.
Thanks.
Comment #14
Pooja Ganjage commentedComment #15
jrockowitz commentedDue to the complexity and challenge of this task, we might want to do interdiff's between patches. This will help people understand what is being fixed/improved.
@see https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Comment #16
jrockowitz commentedOn a slightly related note, we might have to remove the support layer for Drush 8 in the new future.
Comment #17
paulocsPatch #13 doesn't work.
I'll work on it.
Comment #18
paulocsI created a new patch so now webform-generate drush command is working.
I see that the
_validateDrushParams()method is never used and maybe can be removed or used ingenerateElements()but it is not in the issue scope.I'm atttaching a patch and interdiff 13-18.
Comment #19
paulocsI tested
webform-export,webform-importandwebform-generate. They look good with drush 10.The other commands still must be tested.
Comment #20
collinhaines commentedI tested
webform:libraries:download(thereby also testingwebform:libraries:remove) with patch #18 and all libraries downloaded. Webform v6.0.2, Drush v10.4.2.Comment #21
paulocsI finished to test the commands
webform-purge,webform-tidy,webform-libraries-status,webform-libraries-make,webform-libraries-composer,webform-repair,webform-remove-orphans,webform-docs(It works with drush 10 but the README module is no longer supported),webform-composer-update,webform-generate-commands.They all look good with Drush 10, so moving to RTBC.
Comment #22
paulocsMoving back to NW to merge patch from #3194753: Patch to remove drush 10 warning
Comment #23
paulocsAdding the merged patch.
Comment #24
jrockowitz commentedContinuing from #16
I am hoping once Drupal 9.x is the only supported version for Webform 6.x, we only support Drush 10.x.
@see https://www.drush.org/latest/install/#drupal-compatibility
Comment #25
jrockowitz commentedComment #26
jrockowitz commentedComment #27
jrockowitz commentedHere is a backport to 8.x-5.x which I am going to test and hopefully commit.
Comment #28
jrockowitz commentedThe attached patch is for Webform 8.x-5.x and should be easy to apply to 6.x
The changes include...
I ran through the test script using Drush 9 and now I will try Drush 10.
Comment #29
jrockowitz commentedI just ran through the test script in Drush 10 and it is working great.
Attached is the same patch for Webform 6.x
Comment #32
jrockowitz commented