Does not work with PHP 7.3 and 7.4. Help need with PHP 7.0

Created on 8 May 2020, over 4 years ago
Updated 3 March 2023, almost 2 years ago

Just to let you know that the module doe not work with PHP 7.3 (7 pages of warnings and errors after an attempt to load page) and 7.4 (the same).
Please help with PHP 7.0. Output shoes the page with the first character in each field. As I understand, this is not the UTF8 problem, as the issues exist in case of a sequence of numbers: output is "1" if the field value "12345". The width and height parameters of the field left empty.

πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada Ether

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Active almost 2 years ago
  • πŸ‡¬πŸ‡§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 case getCellHeight() 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 almost 2 years ago
  • πŸ‡ΈπŸ‡ͺ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 β†’

Production build 0.71.5 2024