formtools / core

The Form Tools Core.
https://formtools.org
205 stars 78 forks source link

Formtools Fatal Error when upgrading from PHP 7.4 to PHP 8.0 #865

Closed nicktalsma closed 1 year ago

nicktalsma commented 1 year ago

So here is the issue. I created a new form in formtools formbuilder and then setup a new subdomain with my host (1&1) to make navigating to the new form easy.

If I used my old domain (on PHP 7.4) which was the full path to the the form, I was able to use the form and successfully submit.
If I used my new subdomain (automatically setup on PHP 8.0) which was a short path to the form, I was able to see the form, but then got an error on submission. Error below. Changing the subdomain to use PHP 7.4 fixes the issue.

Full disclosure I am on an older version of formtools 3.0.13. Would upgrading to 3.0.20 allow formtools to work with PHP 8.0/8.1?

Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number in /website/formtools/global/code/Database.class.php:126 Stack trace: #0 /website/formtools/global/code/Database.class.php(126): PDOStatement->bindValue('submission_id', '6', 2) #1 /website/formtools/global/code/Submissions.class.php(1000): FormTools\Database->bind('submission_id', '6') #2 /website/formtools/modules/form_builder/code/FormGenerator.class.php(426): FormTools\Submissions::finalizeSubmission(27, '6') #3 /website/formtools/modules/form_builder/form.php(126): FormTools\Modules\FormBuilder\FormGenerator::processFormBuilderPage(Array) #4 /website/formtools/modules/form_builder/published/strategy_op/index.php(12): require_once('/homepages/43/d...') #5 {main} thrown in /website/formtools/global/code/Database.class.php on line 126

Another issue... Before I realized what the PHP issue was, I was just going to try upgrading... A lazy way of hopefully fixing a problem I didn't want to spend time trying to diagnose... Unfortunately I have been unable to download the upgrade package from formtools. I keep getting the "Oops! The server is too busy to handle your request right now." I've tried at least 100 times with no luck...

nicktalsma commented 1 year ago

So I had a sandbox environment running 3.0.2... Oddly, I had no problem creating the upgrade zip file to 3.0.20 (coming from 3.0.2). Upgraded to 3.0.20 without issue. Switched to PHP 8.0 and got the same error. Tried PHP 8.1. Same error. Reverted to PHP 7.4. All works well.

So I assume the current version of formtools is not compatible with anything other than PHP 7.4? Kind of a bummer, because I think my host will start charging me to use 7.4 soon. They call it 'extended support'. Just another way to get money. But I am going to be in a bind here...

luizcesar1980 commented 1 year ago

I had the same problem with one of my customer. I went back to version 7.2 and they kept working.

nicktalsma commented 1 year ago

I had the same problem with one of my customer. I went back to version 7.2 and they kept working.

PHP 7.4 EOL is coming up quick. I really hope Formtools will have an update that makes it compatible with PHP 8.X

luizcesar1980 commented 1 year ago

I do not believe that. Formtools has been practically inactive for at least 1 or 2 years... But I hope that at some point someone will take over and move on.

benkeen commented 1 year ago

Hey folks, I just released 3.1.0. It's running fine for me on PHP 8.2, but do let me know if anyone spots any problems. You can download the new version on the main download page here: https://formtools.org/download/ - but I'll be updating the Upgrade page in coming days to explain why the upgrade functionality is no longer automated.

As I posted on the website I'll be sticking around for bug fixes from here on out.