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

Comments

wizonesolutions’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
StatusFileSize
new1.44 KB

I'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.

liam morland’s picture

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

liam morland’s picture

Since there are no tests now, perhaps this issue should be marked as fixed and a task issue opened about writing tests.

wizonesolutions’s picture

Status: Needs work » Fixed

I agree.

wizonesolutions’s picture

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

  • Commit ca948d4 on 7.x-1.x, 7.x-2.x, 7.x-2.x-tests1, 7.x-1.x-ubercartbackporttest authored by Liam Morland, committed by wizonesolutions:
    Issue #1355090: Include Webform dependencies more intelligently.