- Status changed to Active
over 1 year ago 8:42am 22 February 2023 - π¬π§United Kingdom scareyclott
I am still having this issue with tabl view. Have tried unformatted list and the renders but i get this same error for table. Using PHP 7.4
Anyone suggest a fix
Using tables:
Error: Call to undefined method PdfTemplate::getCellHeight() in PdfTemplate->drawTable() (line 684 of C:\inetpub\wwwroot\aims\public\sites\all\modules\views_pdf\views_pdf_template.php). - π¬π§United Kingdom rickj
This is extremely puzzling. The error says that the method
getCellHeight()
doesn't exist, but the call is$this->getCellHeight()
, i.e. to a method in the current class - or in this case a parent class. The calling code can only execute because the class has been instantiated, so how can the method not exist?PdfTemplate's inheritance is not completely straight-forward though. It has a cascade of parent classes in the FPDI & TCPDF libraries, in particular a conditional inheritance in fpdi_bridge.php. The condition is
class_exists('TCPDF', false)
. This should always be true, but if it evaluates false the code will extend class FPDF instead of TCPDF, and in that casegetCellHeight()
won't exist.But it doesn't make sense that the evaluation should fail; the libraries are all loaded at the start of views_pdf_template.php, and class FPDF doesn't exist either, so an attempt to extend that should result in an immediate error.
I'm wondering if it could be a PHP problem with available RAM. The whole of views-pdf drags in a large amount of code, so in a marginal case could lack of RAM result in strange behaviour rather than actual out-of-memory errors?
Can I suggest checking the server configuration and upping the max. memory allocation if possible?
- π¬π§United Kingdom scareyclott
Thanks for the reply RickJ. The thing is it used to work fine and i think the PHP upgrade is what has caused it. I will have a play with the RAM but since the unformatted list works i don't think this will be the issue.
- π¬π§United Kingdom scareyclott
I have just noticed my TCPDF library is out of date mybe this is the issue. Just need to work out how to update this as trying to rename the file to old in the libraries folder to upload a new one says it is in use.
Printer, email and PDF versions - PDF generation library
Unsupported TCPDF version
The currently selected version of TCPDF (6.0.020) is not supported. Please update to version 6.2.22 or newer. - π¬π§United Kingdom rickj
TCPDF version could well be the problem. I have version 6.3.5, and that's at least 2 years old.
- Status changed to Postponed: needs info
over 1 year ago 9:22am 3 March 2023 - πΈπͺSweden killua99
@scareyclott
I do understand you're still having issues.
But, I'll like to ask if you have the possibilities to upgrade your entire platform to PHP8.0 or latest supported for Drupal 7. Also upgrade your module to the latest version and upgrade the libraries to the recommended version or greater.
Please before doing any of this consider make some backups previously your start upgrading.
Currently the active version of this module are the version 7.x-3.x and 3.x (for Drupal 9 and Drupal 10)
Above some links with info with current supported versions:
* https://www.drupal.org/docs/7/system-requirements/php-requirements β
* https://www.drupal.org/docs/7/modules/views-pdf/installation β