I'm generating a PDF from a form. It works as expected until I try to set a password for the file. below is the error:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/admin/pages/chronoforms/actions/tcpdf/output.php:47\nStack trace:\n#0 /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/admin/pages/display_element.php(206): require()\n#1 /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/admin/pages/view.php(258): require('...')\n#2 /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/admin/pages/view.php(356): ChronoApp->{closure}()\n#3 /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/chrono_lib/chrono.php(673): require('...')\n#4 /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/chronoforms.php(47): ChronoApp->processExtension()\n#5 /var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/chronoforms.php(60): chronoforms_page_content()\n#6 /var/www/vhosts/website.com/httpdocs/wp-includes/shortcodes.ph...', referer: https://www.website.com/bzi8jeylvlw7j8ggq01pxwgs/
Hi
Thank you for reporting this issue
You can open that file:
/var/www/vhosts/website.com/httpdocs/wp-content/plugins/chronoforms/admin/pages/chronoforms/actions/tcpdf/output.php
and change line 47 to:
$perms = (count(Chrono::getVal($action, 'permissions', [])) > 0) ? Chrono::getVal($action, 'permissions', []) : array();
but this issue should be fixed in the next update.
the initial error is now gone. but the password if have set doesn't work. I tried multiple pdf viewers and download methods.AH01071: Got error 'PHP message: PHP Warning: Undefined array key "Length" in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/tcpdf.php on line 10849; PHP message: PHP Warning: Undefined array key "Length" in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/tcpdf.php on line 10790; PHP message: PHP Warning: Trying to access array offset on null in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Trying to access array offset on null in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 498; PHP message: PHP Warning: Undefined array key 2 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 3 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 4 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 5 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 6 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 7 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 8 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 9 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 10 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 11 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 12 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 13 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 14 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 15 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 16 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 17 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 18 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 19 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 20 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 21 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 22 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 23 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 24 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 25 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 26 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 27 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 28 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 29 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 30 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 31 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 32 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Trying to access array offset on null in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Trying to access array offset on null in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 498; PHP message: PHP Warning: Undefined array key 2 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 3 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 4 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 5 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 6 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 7 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 8 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 9 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning: Undefined array key 10 in /var/www/vhosts/rpm-it.ch/httpdocs/wp-content/plugins/chronoforms/admin/libs/tcpdf/include/tcpdf_static.php on line 496; PHP message: PHP Warning:
What happens when you change that line to:
$perms = [];
Try also to set the next line to:
$pdf->SetProtection($perms, Chrono::getVal($action, 'user_pass', ""), $owner_pass, Chrono::getVal($action, 'sec_mode', 0), $pubkeys=null);
And did you set both a User Password and an Owner Password ? both are required.
i changed both lines, fixed the issue. passwords were already both set. thanks a lot.
Great, thanks for the confirmation.
