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.

CommentFileSizeAuthor
#3 webform_export_options-2027747.patch1.77 KBquicksketch
#1 add_class_options-2027747-2.patch921 bytesAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

here's the patch

quicksketch’s picture

Thanks, 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

quicksketch’s picture

Version: 7.x-3.19 » 7.x-4.0-alpha9
FileSize
1.77 KB

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

quicksketch’s picture

Title: Add form download options to the class » Add form download options to the class / Convert to PHP5 OOP in export classes
Status: Needs review » Fixed

Committed to 7.x-4.x.

quicksketch’s picture

I made an upgrade entry for this issue: https://drupal.org/node/1609324#webform-exporters

Status: Fixed » Closed (fixed)

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