osclass / Osclass

With Osclass, get your own classifieds site for free. Build your own Osclass installation and start advertising real estate, jobs or whatever you want- in minutes!
http://osclass.org/
648 stars 343 forks source link

pre_item_add_error hook doesn't work #2248

Closed juliolopez78 closed 6 years ago

juliolopez78 commented 6 years ago

Hello,

The new pre_item_add_error doesn't work. The apply filter call on line 171 of ItemActions.php should catch the return value, otherwise $flash_error cannot be modified. ItemActions needs to be modified like so:

// Line 171
$flash_error = osc_apply_filter('pre_item_add_error', $flash_error, $aItem);

Same goes for the filter on line 376.

Alternatively, Plugins::applyFilter could be modified to pass in the args as references on line 57 of Plugins.php. However, this will mean that all content to be filtered by each and every filter hook will be passed in as a reference and that may not be desired in every case.

Thanks in advance.

garciademarina commented 6 years ago

Thanks for the information , we will try to fix in the next version.