When using the entity-reference-items option in drush export command, It throws the following error.

Unable to decode output into JSON: Syntax error                                                                                                                                       
                                                                                                                                                                                        
  TypeError: Argument 1 passed to Drupal\webform\Plugin\WebformElementBase::prefixExportHeader() must be of the type array, string given, called in /var/www/web/modules/contrib/webfo  
  rm/src/Plugin/WebformElement/WebformEntityReferenceTrait.php on line 307 in Drupal\webform\Plugin\WebformElementBase->prefixExportHeader() (line 1909 of /var/www/web/modules/contri  
  b/webform/src/Plugin/WebformElementBase.php).

The drush command to use:

drush wfx webform_id --delimiter=';' --langcode=nl --entity-reference-items=id

Issue fork webform-3267068

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hmdnawaz created an issue. See original summary.

hmdnawaz’s picture

hmdnawaz’s picture

hmdnawaz’s picture

Status: Active » Needs review
hmdnawaz’s picture

michel.g’s picture

Status: Needs review » Reviewed & tested by the community

Good catch

jrockowitz’s picture

Version: 6.2.x-dev » 6.1.x-dev
Status: Reviewed & tested by the community » Needs work

We need to create a webform that can be used to replicate this issue and possibly add some test coverage.

This bug can also be addressed via 6.1.x.

JdeGraaff’s picture

This patch solved my issue:
ParseError: syntax error, unexpected identifier "WebformElementBase", expecting "function" or "const" in Composer\Autoload\includeFile() (regel 1887 van /var/www/html/web/modules/contrib/webform/src/Plugin/WebformElementBase.php)

jrockowitz’s picture

I am able to replicate this issue using the attached webform and the below drush command

drush wfx issue_3267068 --entity-reference-items=id

jrockowitz’s picture

Status: Needs work » Needs review
FileSize
824 bytes

I think I found the root cause of this issue. Please review the attached patch.

  • jrockowitz authored d0fc6ed on 6.1.x
    Issue #3267068 by hmdnawaz, jrockowitz: TypeError: Argument 1 passed to...

  • jrockowitz authored d0fc6ed on 6.x
    Issue #3267068 by hmdnawaz, jrockowitz: TypeError: Argument 1 passed to...

  • jrockowitz authored d0fc6ed on 6.2.x
    Issue #3267068 by hmdnawaz, jrockowitz: TypeError: Argument 1 passed to...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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