Question: PDF and CSV generation are not working

PDF and CSV generation are not working

Installed version Stock Manager Advance with POS Module v3.4.31. The live version is v3.4.29 hence can't test. using PHP 7.3.16 (cli) (built: Mar 17 2020 10:18:38) ( NTS ) with all the rec

BE

Benjamin Eshun

Asked
Installed version Stock Manager Advance with POS Module v3.4.31. The live version is v3.4.29 hence can't test.
using
PHP 7.3.16 (cli) (built: Mar 17 2020 10:18:38) ( NTS ) with all the recommended extensions installed.

The code breaks each time I tried to generate a pdf or CSV file
  • BE

    Benjamin Eshun

    Answered
    Hi,

    I installed the php-xml and php -i gave

    dom

    DOM/XML => enabled
    DOM/XML API Version => 20031129
    libxml Version => 2.9.1
    HTML Support => enabled
    XPath Support => enabled
    XPointer Support => enabled
    Schema Support => enabled
    RelaxNG Support => enabled


    xml

    XML Support => active
    XML Namespace Support => active
    libxml2 Version => 2.9.1

    xmlreader

    XMLReader => enabled

    xmlwriter

    XMLWriter => enabled

    however I still get

    ERROR - 2020-04-06 10:36:42 --> Could not find the language line "234.0000"
    ERROR - 2020-04-06 10:36:42 --> Could not find the language line "35.0000"
    ERROR - 2020-04-06 10:36:42 --> Could not find the language line "15.0000"
    ERROR - 2020-04-06 10:36:42 --> Severity: error --> Exception: Class 'PhpOffice\PhpSpreadsheet\Shared\XMLWriter' not found /var/www/user/data/www/domain.tld/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php 5

    when I try to export 3 Sales to csv

    and I get

    ERROR - 2020-04-06 09:44:29 --> Severity: Warning --> file_exists(): open_basedir restriction in effect. File(/tmp/log.htm) is not within the allowed path(s): (/var/www/user/data:.) /var/www/user/data/www/domain.tld/vendor/dompdf/dompdf/src/Dompdf.php 723
    ERROR - 2020-04-06 09:44:29 --> Severity: Warning --> is_writable(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/user/data:.) /var/www/user/data/www/domain.tld/vendor/dompdf/dompdf/src/Dompdf.php 723
    ERROR - 2020-04-06 09:44:29 --> Severity: Warning --> is_writable(): open_basedir restriction in effect. File(/tmp/log.htm) is not within the allowed path(s): (/var/www/user/data:.) /var/www/user/data/www/app.tuameka.com/vendor/dompdf/dompdf/src/Dompdf.php 728
    ERROR - 2020-04-06 09:44:29 --> Severity: Warning --> file_put_contents(): Filename cannot be empty /var/www/user/data/www/domain.tld/vendor/dompdf/dompdf/src/FontMetrics.php 212
  • MS

    Mian Saleem

    Answered
    Hello,

    **The live demo is v3.4.31** Please follow up with single question instead of asking new questions for same issue.

    I think these all are due to wrong file permissions. Please check permissions for all your files and folders and the owner user and group are correct. You can check with your server admin/host.

    Thank you
  • BE

    Benjamin Eshun

    Answered
    Hi,

    Sorry for the misunderstanding, the questions where not new but related to the subject matter of this trend. However in line with your suggestion, when try to export any of the lists to excel I get the following error.

    ERROR - 2020-04-14 11:52:51 --> Severity: error --> Exception: Class 'PhpOffice\PhpSpreadsheet\Shared\XMLWriter' not found /var/www/user/data/www/xxxx.xyz/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php 5

    Would be grateful for any assistance locating the class file.

    Thank you.
  • MS

    Mian Saleem

    Answered
    Please pay attention on my previous reply.

    > I think these all are due to wrong file permissions. Please check permissions for all your files and folders and the owner user and group are correct. You can check with your server admin/host.

    You said you have already installed the php-xml extension. I hope you have restarted the server (apache) after that. You can double check the php version.

    Thank you
  • BE

    Benjamin Eshun

    Answered
    Hi,

    Yes version of php is
    PHP Version => 7.3.17
    XMLWriter => enabled

    I have restart and reinstall the application several times, even on different servers and checked the permissions. And each time I get the exact same error message.

    Thanks.
  • MS

    Mian Saleem

    Answered
    I have no clue. If you have enable the extension then there shouldn't be error for that extension :( May be you can try php7.4 to test.

    Please create a php file in the SMA folder to print `<?php phpinfo(); ?>` and check the page to make sure of version and extensions.

    Thank you
  • L

    Lithin

    Answered
    I had the same issue. I was able to fix this issue by downloading and replacing the phpoffice folder under vendor from here:

    https://php-download.com/package/phpoffice/phpspreadsheet/file/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
  • Login to Reply