Depending on the Webform version, Fill PDF needs to include either "includes/webform.submissions.inc" or "webform_submissions.inc". Currently, Fill PDF chooses which to do based on the version string of Webform, but that is not robust and fails if one is using a development version of Webform, which has no version number.
The attached patch takes advantage of the fact that module_load_include() tests for the existence of a file before trying to include it and returns false if it does not exist. The patch tries to include "includes/webform.submissions.inc" and, if that fails, includes "webform_submissions.inc".
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fillpdf_1355090_webform_include.patch | 1.44 KB | wizonesolutions |
| fillpdf_webform_inc.patch | 1.44 KB | liam morland |
Comments
Comment #1
wizonesolutionsI'm fine with this, so I've committed it tentatively to the development version (with attribution to you). However, I would like to start writing Simpletests at this point. Do you happen to know anything about that? As more features come in, making sure the code doesn't break will be invaluable.
I made a minor change to the check for
$included. Whenever we can strictly check for a FALSE value, we should. It performs slightly better than!$variable. Revised patch attached.Comment #2
liam morlandI have not written any new tests. I have made minor changes to existing tests in core. The tests that I have looked at just compare the output of a module with a regex to see if it is generating what it should be.
Comment #3
liam morlandSince there are no tests now, perhaps this issue should be marked as fixed and a task issue opened about writing tests.
Comment #4
wizonesolutionsI agree.
Comment #5
wizonesolutionsStarted #1393056: [Meta] Write tests.