codefog / contao-haste

Haste is a collection of tools and classes to ease working with Contao
http://codefog.pl/extension/haste.html
MIT License
42 stars 24 forks source link

Recoverable Error Ajax Reload Listener #100

Closed sgn-dev closed 7 years ago

sgn-dev commented 7 years ago

Hallo zusammen,

im Zusammenspiel mit Isotope 2.4.1 & Contao 3.5.24 sowie haste 4.16.0 erhalte ich im Frontend folgende Warnung:

Recoverable error: Argument 1 passed to Haste\EventListener\AjaxReloadListener::onGetContentElement() must be an instance of Contao\ContentModel, instance of CustomElements\Models\Content given, called in /kunden/**/system/modules/core/library/Contao/Controller.php on line 491 and defined in system/modules/haste/library/Haste/EventListener/AjaxReloadListener.php on line 21

LG Holger

qzminski commented 7 years ago

What extension do you use for custom content elements?

sgn-dev commented 7 years ago

Ah shit.... i see - thats my own Extension :(

What must i do to solve the problem?

qzminski commented 7 years ago

Apparently you are trying to execute the getContentElement hook passing the class that does not extend Contao\ContentModel as first argument. That is incorrect as it should be compatible with Contao genuine hook definition.

sgn-dev commented 7 years ago

Strange... i do not use any Hook in this Extension. Can it be related to the content model I use in my extension?

qzminski commented 7 years ago

Hmm difficult to say what's wrong without look at the source code. Do you override the ContentModel or ContentElement class in the autoloader perhaps?

The exactly same issue happens in the in the Content-Box extension but there the getContentElement hook is called internally with wrong parameters. Guess the extension is just outdated.

sgn-dev commented 7 years ago

okay.. if i "disabled" my own Content-Model everythings okay :) Okay... i try to fix it ...

Thanx a lot for the help...