formtools / core

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

Fatal error: Call to undefined function smarty_modifier_custom_format_date() #427

Open HarborSide opened 5 years ago

HarborSide commented 5 years ago

I upgraded from 2.2.6 to 3.0.6 (latest version) of form tools.

I am using he form builder.

When I go to "forms" and then "view" I get this error:

Call to a member function prepare() on null in ./ft/global/code/Database.class.php on line 71Fatal error: Call to undefined function smarty_modifier_custom_format_date() in ft/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(53) : eval()'d code on line 33.

Can you tell me how this might be resolved. Thank you, HarborS

flcowboy7 commented 5 years ago

Once you get logged back in, I would make a point of upgrading all the modules and the core, until there are no more updates available. After every upgrade, make sure to login and visit the modules area, and upgrade them manually, by clicking the upgrade links.

benkeen commented 5 years ago

Hey @HarborSide, isn't this the same issue we encountered before? I was unable to track down the source but it's something to do with how Smarty is running on your server. I created this ticket on Smarty's repo, but no feedback yet: https://github.com/smarty-php/smarty/issues/523

HarborSide commented 5 years ago

Yes, Ben this appears to be the same as before. ftcowboy, I have upgraded all modules as requested by Ben (at an earlier time); currently no updates remain.

I await your good word on resolving this once and for all. It appears to be the final item waiting to be resolved with our recent form tools upgrade, HarborS

flcowboy7 commented 5 years ago

@benkeen - What PHP extensions are required for smarty_modifier_custom_format_date() to work properly? I know on my dedicated server, I had to manually install some of those extensions after upgrading to PHP 7.2. Could that be part of the problem?

benkeen commented 5 years ago

That's just it, no extensions are needed beyond Smarty - something I've found consistently robust over all the years I've used it. I even got the opportunity to try debugging this on her server but once I realized it was in Smarty I wasn't able to figure out where in the code it wasn't behaving properly. The upshot is that Smarty doesn't recognize the plugins folder had been set - and therefore (correctly) fails to find that extension it complains about. But from everything I could see, the folder is being set correctly.

My best guess is that it's something to do with running multiple smarty instances at the same time, and on her server that's causing a problem here. But beyond that I rather need help from the Smarty guys.

flcowboy7 commented 5 years ago

No - I mean, the server she is hosted on might need PHP extensions for that Smarty function to work properly. For example: php72-php-calendar. For reference, I've made a list of all the PHP 7.2 extensions I have currently installed. I'm not getting the same error as the OP. Maybe she can check with her web host and verify that some or all of these PHP extensions are installed on the server?

Maybe the Smarty guys can help verify which of these would be required??

flcowboy7 commented 5 years ago

php72-libc-client php72-pear php72-php-bcmath php72-php-calendar php72-php-cli php72-php-common php72-php-curl php72-php-devel php72-php-exif php72-php-fileinfo php72-php-ftp php72-php-iconv php72-php-imap php72-php-ioncube10 php72-php-litespeed php72-php-mbstring php72-php-mysqlnd php72-php-pdo php72-php-posix php72-php-process php72-php-sockets php72-php-tidy php72-php-xml php72-php-xmlrpc php72-php-zip php72-runtime

HarborSide commented 5 years ago

Thank you, I will inquire. HarborS

HarborSide commented 5 years ago

I spoke with the web host and the support dept. had many concerns about adding what they called a "smattering of script". They said it appears (I'm quoting) "every possible module thought of" was included here in the list as a suggestion to try, and not one module in particular to correct the existing error. The main concern with adding this much script is the risk that opens up to the website if it were to be hacked. Adding all of these extensions could be harmful and they advised against it.

Please advise, HarborS

flcowboy7 commented 5 years ago

LOL, not even close. There are LOTS more PHP extensions that can be installed. The collection I quoted is actually a small list. (FYI - they are NOT modules, which are something different entirely).

I don't know whether any of the extensions I listed will resolve your error or not, as I am not a PHP developer. I only listed them as a potential reference, since they are the extensions I am currently using on my dedicated server and I am not encountering the same errors that you are.

They would be correct in saying that adding a bunch of extensions for no reason could potentially be harmful, but that isn't what you were attempting to do.

That being said, @benkeen stated earlier that no particular PHP extensions would be required to properly run FormTools. So the error you are seeing may be completely unrelated to my suggestions. I would wait to see if Ben has any new advice for you.