JoomGalleryfriends / JoomGallery

A native image gallery component for Joomla!
http://www.en.joomgalleryfriends.net/
GNU General Public License v3.0
10 stars 6 forks source link

onContentPrepareData() expected to be a reference #90

Closed reilldesign closed 2 years ago

reilldesign commented 3 years ago

when using this plugin https://github.com/nikosdion/sortbyfield

i get the following error message Warning: Parameter 2 to plgSystemSortbyfield::onContentPrepareData() expected to be a reference, value given in /www/htdocs/w00ae4e1/CMS_3/libraries/joomla/event/event.php on line 70

here is the answer from the developer https://github.com/nikosdion/sortbyfield/issues/1

apparently it refers to this code (administrator/components/joomgallery/models/image.php) $this->_mainframe->triggerEvent('onContentPrepareData', array(_JOOM_OPTION.'.image', $row));

is there a solution for this?

reilldesign commented 3 years ago

this code (administrator/components/joomgallery/models/category.php) $this->_mainframe->triggerEvent('onContentPrepareData', array(_JOOM_OPTION.'.category', $this->_data));

generates this error message Warning: Parameter 2 to plgSystemSortbyfield::onContentPrepareData() expected to be a reference, value given in /www/htdocs/w00ae4e1/CMS_3/libraries/joomla/event/event.php on line 70

Elfangor93 commented 3 years ago

Confirmed. In the FormModel.php of the MVC pattern from the Joomal core the second argument of 'onContentPrepareData' is passed by reference: https://github.com/joomla/joomla-cms/blob/964de78b665a1dce8ee381157e3c100027ba6400/libraries/src/MVC/Model/FormModel.php#L292

Elfangor93 commented 2 years ago

This will be fixed with PR #78

Elfangor93 commented 2 years ago

I close this issue since the PR fixing this issue is merged...