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

Comments

alexshipilov created an issue. See original summary.

alexshipilov’s picture

Assigned: alexshipilov » Unassigned
Status: Active » Needs review
StatusFileSize
new6 KB

please review

jrockowitz’s picture

Thanks for contributing the patch. I linked to some related issues which include additional deprecated functions.

jrockowitz’s picture

Status: Needs review » Needs work
paulocs’s picture

Status: Needs work » Needs review
StatusFileSize
new2.27 KB
new6.6 KB

Replaced deprecated $drupal_root = $this->drush_get_context('DRUSH_DRUPAL_ROOT');

ryan.ryan’s picture

Issue summary: View changes

I'm adding `drush_get_context` to the list, as it breaks `drush webform:composer:update`.

zipymonkey’s picture

Re-rolled the patch for the 6.0.0 release.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community

For me it looks good!

jrockowitz’s picture

StatusFileSize
new3.25 KB
new7.32 KB

Patch for 8.x-5.x with Drush 9 support.

jrockowitz’s picture

Status: Reviewed & tested by the community » Needs work

When 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

paulocs’s picture

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

Pooja Ganjage’s picture

StatusFileSize
new8.68 KB

Hi,

Creating a patch as suggested in #12 comment.

Please review the patch.

Thanks.

Pooja Ganjage’s picture

Status: Needs work » Needs review
jrockowitz’s picture

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

jrockowitz’s picture

On a slightly related note, we might have to remove the support layer for Drush 8 in the new future.

paulocs’s picture

Assigned: Unassigned » paulocs

Patch #13 doesn't work.
I'll work on it.

paulocs’s picture

Assigned: paulocs » Unassigned
StatusFileSize
new9.3 KB
new2.73 KB

I 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 in generateElements() but it is not in the issue scope.
I'm atttaching a patch and interdiff 13-18.

paulocs’s picture

I tested webform-export, webform-import and webform-generate. They look good with drush 10.
The other commands still must be tested.

collinhaines’s picture

I tested webform:libraries:download (thereby also testing webform:libraries:remove) with patch #18 and all libraries downloaded. Webform v6.0.2, Drush v10.4.2.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community

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

paulocs’s picture

Status: Reviewed & tested by the community » Needs work

Moving back to NW to merge patch from #3194753: Patch to remove drush 10 warning

paulocs’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new237 bytes
new9.58 KB

Adding the merged patch.

jrockowitz’s picture

Continuing 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

jrockowitz’s picture

Issue summary: View changes
jrockowitz’s picture

Issue summary: View changes
jrockowitz’s picture

StatusFileSize
new9.64 KB

Here is a backport to 8.x-5.x which I am going to test and hopefully commit.

jrockowitz’s picture

Version: 6.x-dev » 8.x-5.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new12.23 KB
new21.26 KB

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

jrockowitz’s picture

StatusFileSize
new21.2 KB

I just ran through the test script in Drush 10 and it is working great.

Attached is the same patch for Webform 6.x

  • jrockowitz authored 72e3b99 on 8.x-5.x
    Issue #3164855 by jrockowitz, paulocs, alexshipilov, Pooja Ganjage,...

  • jrockowitz authored 72e3b99 on 6.x
    Issue #3164855 by jrockowitz, paulocs, alexshipilov, Pooja Ganjage,...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.