I'm getting the following error when trying to get a PDF of a form submission:

Fatal error: Call to undefined method W2PDF::AliasNbPages() in .../sites/all/modules/webform2pdf/includes/webform2pdf.download.inc on line 26

It appears that the method AliasNbPages() has been renamed in the tcpdf library and the new name is getAliasNbPages(). This affects lines 26 and 143 of webform2pdf.download.inc and line 616 of webform2pdf.module.

Comments

BaraSoft2’s picture

Priority: Normal » Critical

I have the same probelm any suggestions?

BaraSoft2’s picture

Priority: Critical » Normal
ffucito’s picture

Version: 7.x-3.x-dev » 7.x-3.0

Same problem. Seems to be a non compatibility with tcpdf.

pene’s picture

Same here at admin/reports/status. So I can not see my page's status without disabling the modul. 7.x-3.0

obisean’s picture

The function name should be getAliasNbPages() not AliasNbPages(). There are three calls to this function, one in webform2pdf.module and 2 in webform2pdf.download.inc

Once I changed the the function name to getAliasNbPages() in these two files it worked

RyanPrice’s picture

Can confirm #5 solves the issue.

mr.york’s picture

Status: Active » Needs review
StatusFileSize
new2.23 KB

Here is the patch which fixes the bug.

duksh’s picture

Hi Mr. York, am sorry for asking this beginner's question but I've never been able to figure out how to use the patch files provided for Drupal modules. I am having the error that your patch is supposed to address, could you please explain how and where do I apply the patch file you provided? sorry for taking your time on this. Thanks

krh121791’s picture

I can confirm that #5 fixes the issue. The function should be getAliasNbPages() in the file webform2pdf.download.inc on line 20.

houmem’s picture

#7 fixes the issue, it works for me

RyanPrice’s picture

Status: Needs review » Reviewed & tested by the community
cybermache’s picture

After making these changes I get this error
Strict warning: Declaration of W2PDF::setHeaderData() should be compatible with TCPDF::setHeaderData($ln = '', $lw = 0, $ht = '', $hs = '', $tc = Array, $lc = Array) in include_once() (line 9 of .../sites/all/modules/webform2pdf/webform2pdf.class.inc).

mr.york’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Thank you. Commited.

Status: Fixed » Closed (fixed)

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