terminal42 / contao-ajaxform

Submit a form through ajax and display error or confirmation message.
14 stars 7 forks source link

Call to undefined method InsertTags::replace()' #10

Closed reluem closed 6 years ago

reluem commented 7 years ago

[20.07.2017 20:30:00] PHP Fatal error: Uncaught exception 'Error' with message 'Call to undefined method InsertTags::replace()' thrown in /is/htdocs/xxxx/www/xxx/composer/vendor/terminal42/contao-ajaxform/AjaxForm.php on line 110

any idea why this would happen? Installed both latest release, develop branch and older 1.0.4. The latter doesn't throw the error, basically because this method was only introduced in 1.0.5 ;)

The only insertTags I'm currently using are the {{fa::icon}} from FontAwesome.

aschempp commented 7 years ago

you're probably using a very old Contao version?

reluem commented 7 years ago

no, Contao 3.5.28, with PHP 7.0.21-he.0 according to the contao-check.

I have absolutely no idea why it's not working any longer. I used this extension for various forms in the past (but only once a year).

reluem commented 7 years ago

Update: form submission works (email via notification center + leads is working), but the ajax refresh to the confirmation page is not working with above mentioned error.

julianlaudan commented 7 years ago

I have the same issue using:

Contao 3.5.24 PHP 7.1 FPM AjaxForm 1.0.5 Build 4

Detailed error message:

Fatal error: Uncaught exception Error with message Call to undefined method InsertTags::replace() thrown in system/modules/ajaxform/AjaxForm.php on line 110

0 system/modules/ajaxform/AjaxForm.php(39): AjaxForm::sendResponse('

julianlaudan commented 7 years ago

Any updates on this issue? @aschempp

aschempp commented 7 years ago

not really, it does not make any sense to me…

qzminski commented 6 years ago

@aschempp the problem is with the inserttags extension that you named the class InsertTags and autoload it the old way, which means you are in fact replacing the original Contao InsertTags class.

https://github.com/terminal42/contao-inserttags/blob/master/config/autoload.php

We have to either rename the class or introduce the namespace, what do you prefer?

qzminski commented 6 years ago

See https://github.com/terminal42/contao-inserttags/commit/097c38ff063ff05e80751bb3d10374f7564362a5