Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As i wrote my own handler to map webform data to a predefined csv file, i missed the form options that defined the export.
In the patch, i've add these options to the delimited class.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform_export_options-2027747.patch | 1.77 KB | quicksketch |
#1 | add_class_options-2027747-2.patch | 921 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedhere's the patch
Comment #2
quicksketchThanks, good call. Because Webform now requires PHP 5 (and has for quite a while), we should go ahead and replace that "var" declaration with another "public".
public has existed in every version of PHP 5: http://www.php.net/manual/en/language.oop5.properties.php
Comment #3
quicksketchThe particular approach taken isn't quite right, you shouldn't need to set
$exporter->options = $options;
right after the constructor just received $options. If you wrote your own exporter, then that means you could simply set $this->options directly in your own class.Admittedly our OOP in the Webform exporters is super-old and maybe not as clear as it could be. I've committed this patch which converts to PHP5-style OOP and sets $options as a public variable. In the mean time if you're using Webform 3.x, I suggest just making your own constructor in your class and saving the $options variable manually. Then when you upgrade to Webform 4.x, this step will be done for you.
Comment #4
quicksketchCommitted to 7.x-4.x.
Comment #5
quicksketchI made an upgrade entry for this issue: https://drupal.org/node/1609324#webform-exporters