In a system plugin I have method public function onContentPrepare($context, &$article, $params, $page = 0).
In a com_contact.contact page view (frontend) the received $params are empty (null) which throws a fatal error when I use $params->get().
Plugin runs on J3 without issues.
I think $this->params in this line is wrong: https://github.com/joomla/joomla-cms/blob/4.0-dev/components/com_contact/src/View/Contact/HtmlView.php#L349
and should be $item->params: like this:
$app->triggerEvent('onContentPrepare', array ('com_contact.contact', &$item, &$item->params, $offset));
$item->params is filled step by step before the line, not $this->params
Compare also with Joomla 3:
https://github.com/joomla/joomla-cms/blob/staging/components/com_contact/views/contact/view.html.php#L306
| Labels |
Added:
?
|
||
| Title |
|
||||||
Not happy but will do ;-)
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-08-05 00:25:04 |
| Closed_By | ⇒ | ReLater | |
| Labels |
Added:
?
Removed: ? |
||
Yup. I agree. As you say $item->params is created on https://github.com/joomla/joomla-cms/blob/4.0-dev/components/com_contact/src/View/Contact/HtmlView.php#L383 after we call this. You happy to do a PR?