formtools / module-form_builder

The Form Builder module.
https://docs.formtools.org/modules/form_builder/
15 stars 21 forks source link

Another "publish" button from Form Builder Module non-responsive #42

Closed rabbypan closed 1 year ago

rabbypan commented 1 year ago

Brand new install of 3.1.0 on webmin on ubuntu.

I opened all folder permissions to 777 (I know, but this is just for testing).
/modules/form_builder/published

With chrome dev tools open while doing this, clicking "publish" from the module, I'm getting failed to load resource". the server responded with 500 internal server error css.php:1 It will still open the publish form page to enter filename and check path/url. Both folder permissions and url match are good

Then clicking on Publish from that window, nothing happens, and dev tools show Post /modules/form_builder/code/actions.php 500 internal server error jQuery.js:16. I click on close, and close the module, I get the forms listed with the default template set as the number of times I clicked on publish. However, they are all listed under published "No".

Can you help steer me in a direction to help resolve this?? I saw in an older post about alter table in mysql to null. however, that didn't resolve the issue.

benkeen commented 1 year ago

Hey @rabbypan, let's see if we can get to the bottom of it! Couple of things to try:

  1. First, let's look at the actual request that happens when you click the Publish button. Open up dev tools in your browser and navigate to the Network tab. That'll list all the various network requests going in and out. What you want to look for is the request that fires right after you click Publish. That'll send a request to a file named actions.php with a publish_form action as part of the payload (see screenshots). I'm interested in what the response from that request is, as shown in the second screenshot. It's possible that there will be no response at all - but that's good information too.

    devtools1 devtools2
  2. Secondly - and this is probably going to be necessary - is to find out where on your hosting provider it stores the error logs, and watch that file right when you click Publish. That'll probably contain more information about exactly what went wrong.

rabbypan commented 1 year ago
Screenshot 2023-02-26 at 5 09 22 PM

The preview screen was empty.

I'll see if I can find the error logs. Thanks for the help!!

rabbypan commented 1 year ago

not sure if this helps but I found some error logs with [Sun Feb 26 20:06:54.311638 2023] [php:error] [pid 9854] PHP Fatal error: Uncaught Error: Call to undefined function FormTools\Modules\FormBuilder\each() in /home/admin/web/localhost/public_html/modules/f orm_builder/code/Forms.class.php:812\nStack trace:\n#0 /home/admin/web/localhost/public_html/modules/form_builder/code/ actions.php(46): FormTools\Modules\FormBuilder\Forms::saveBuilderSettings()\n#1 {main}\n thrown in /home/admin/we b/localhost/public_html/modules/form_builder/code/Forms.class. php on line 812, referer: https://localhost/modules/form_builder/preview.php?form_id=2

benkeen commented 1 year ago

Hi @rabbypan, I'm so sorry - I was on the wrong PHP version. Yes, I can see both these problems now & it's related to PHP 8. I'll get an update out for this module and get back to you soon! Shouldn't be long - give me an hour or two.

benkeen commented 1 year ago

Actually this will require additional changes to the Core as well. Let me work on this & I'll get back to you here about precisely what will need to be updated.

benkeen commented 1 year ago

Allllrighty, so I uncovered a few problems - all PHP 8 related.

You'll need to update to the following:

I also updated System Check (2.2.0) and the Submission History (2.1.0) modules. These was unrelated, but there was a similar PHP 8 incompatibility there, so I went ahead and updated them.

All but the Submission History module can be downloaded from the main download page: https://formtools.org/download/

Let me know how it goes - and hope this helps!

rabbypan commented 1 year ago

So far so good. Did a few tests. Gotta say Ben, your support has been AWESOME!! Thanks again. Will let you know if anything else shows up.

benkeen commented 1 year ago

My pleasure! Thanks for reporting the issue.