Closed richardhj closed 7 years ago
Does your model extend \Contao\Model
? I am not sure if we should change that though because Contao should expect ContentModel
by default. @Toflar @aschempp
Does your model extend \Contao\Model?
Exactly.
It must extend ContentModel
. There are many, many other places where this code would fail otherwise (e.g. the isVisibleElement
hook where you MUST check for an instance of content element or front end module). So nothing to do here imho.
Yup, I think so too. @richardhj I suggest that you extend ContentModel
and have some method that works as a proxy for all the stuff you currently have in your custom model.
Your
onGetContentElement
wants argument 1 to be aContentModel
. However, I use a custom model, which indeed uses the functionality oftl_content
but is no child ofContentModel
.For instance, I use
Controller::getContentElement()
for my purposes, using my custom model, causing the following error: