Webform 6.1.4 breaks drush data export

Created on 23 January 2023, almost 2 years ago
Updated 14 February 2023, almost 2 years ago

Problem/Motivation

Up until 6.1.3, drush wfx <formid> gave me exports as expected.
Starting with 6.1.4, I only get > [notice] Exported 0 of 0 submissions…
Using Drupal 9.4.10, no outstanding DB update, rebuilt cache.

Steps to reproduce

Submit an entry in the default "Contact form".
Export it using the webGUI: Works.
Export it via drush wfx contact:
> [notice] Exported 0 of 0 submissions…
(and then only the column headers get shown).

Nothing in the logs related to Webform.

If I downgrade to 6.1.3 with composer require drupal/webform:6.1.3 (without any further actions), Drush exports of the submission just entered work successfully.

I sieved through the commits of 6.1.4 but was pretty blown away by the sheer number of commits and o.t.o.h. did not see anything obviously suspicious. But I am not a developer, just a sysadmin.

Can anyone confirm they see this as well or is this something specific to my setup?
If this is a general regression it might warrant a major priority as it completely but silently breaks automated setups that operate on submissions.

My internal ticket 11169

🐛 Bug report
Status

Fixed

Version

6.1

Component

Code

Created by

🇦🇹Austria tgoeg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tgoeg
  • 🇧🇪Belgium michel.g

    Indeed, I have checked the changes as well and with some debugging I've found that the removal of an access exclusion was the cause of it. The drush user just didn't have access anymore to the query results.

    I have attached a patch which puts that line back. There was probably a reason for the removal but I will let this discussion for the maintainers.

  • Status changed to Needs review almost 2 years ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    Maybe we only disable access checking via Drush CLI.

  • 🇦🇹Austria tgoeg

    Sounds reasonable to me, people with access to drush have other means of accessing this data anyway, no harm done in allowing everyone with CLI access to also be able to export results.

    I can confirm this solves the problem for me.

    To see whether this only applies to exports, I also tried purging submissions via drush, which worked.

    I also exported the complete resultset as CSV via drush, used pm:enable webform_submission_export_import and tried to re-import the exported data.

    It failed at importing because it stated mandatory fields were missing (which is wrong, they are part of the exported CSVs).

    If I skip the validation with --skip_validation=<first field that needs validation>, the import basically seems to work, apart from errors like
    > [error] <myform>: Email not sent for <myhandler> handler because a To, CC, or BCC email was not provided
    (which is also wrong, as the export definitely contains the needed fields).
    I am unsure what value to pass for --skip_validation[=SKIP_VALIDATION] as a description for the needed value is missing from the usage output (I guess a comma separated list of fields?)

    The import ends with

    >  [notice] Imported 4 of 4 submissions…
    >  [notice] Submission import completed. (total: 4; created: 4; updated: 0; skipped: 0)

    However, I don't see any relevant data in the submissions, only 127.0.0.1 as submission IP gets added, but no actual submission data.

    There is no data added to table webform_submission_data.

    The same happens with 6.1.3 as well, however, so I am not sure whether this is related. I guess this should go in another ticket.

    I don't have any setup right now that allows me to test whether other drush commands might be hindered by the (permission changes in the) 6.1.4 update.

    Thanks!

  • 🇺🇸United States jrockowitz Brooklyn, NY

    Does the patch fix the immediate issue? Can it be committed AS-IS?

  • 🇦🇹Austria tgoeg

    As I said,

    I can confirm this solves the problem for me.

    If that's enough, then yeah.
    I just wanted to probably raise awareness that other functionality might also be affected and I may not have covered it fully by my manual test.
    I'll open a separate ticket for the other findings.

    • jrockowitz authored 5bd2b1d1 on 6.1.x
      Issue #3335851 by michel.g, jrockowitz: Webform 6.1.4 breaks drush data...
    • jrockowitz authored 5bd2b1d1 on 6.x
      Issue #3335851 by michel.g, jrockowitz: Webform 6.1.4 breaks drush data...
    • jrockowitz authored 5bd2b1d1 on 6.2.x
      Issue #3335851 by michel.g, jrockowitz: Webform 6.1.4 breaks drush data...
  • Status changed to Fixed almost 2 years ago
  • 🇺🇸United States jrockowitz Brooklyn, NY
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024