item.delete.[colection] action hook doesn't return $data parameter. Instead it returns an ID for a row that doesn't exists anymore in case of :after.
var_dump the first parameterReturn full data from the item you're trying to delete
Returning only ID from an item that in some cases doesn't exist.
This was the function for the action hook i used when testing:
'item.create.table' => function($data){
var_dump($data);
},
Thank you for the report @Mozz4rt 馃檪 @hemratna or @bjgajjar will be having a look at this issue soon.
@Mozz4rt
We developed the explicit code like the delete hook will have an ID only instead of the object.
May I know the usecase of this functionality?
We have to consider this as a feature request instead of a bug. Let me know your thoughts @benhaynes
I'm not sure what is standard, but I could see why it would be nice to have the item info in the hook (eg: so you could send an email/notification saying XXXXX item was deleted. Any thoughts @rijkvanzanten ?
@benhaynes Funny enough, that's exactly what I was hoping to achieve.
@bjgajjar the problem with returning the id and why i see It as a bug is that :after delete you can't do much with the returned id since it's no longer in the database, the expected would be an obj copy of the deleted item for further use..
@Mozz4rt
This issue is resolved with #882. I just added the extra parameter along with ID. So the other user's who used this hook earlier, they will not be affected by this change.
Most helpful comment
@Mozz4rt
This issue is resolved with #882. I just added the extra parameter along with ID. So the other user's who used this hook earlier, they will not be affected by this change.