Question about php FORM plugin:On record deletion (onDeleteRowsForm)

troester

Well-Known Member
Staff member
How is it supposed to work?
I'm trying to send a mail with some record data and then delete the record

Php code is in code field (not in file)

Placeholders are empty if the element is readonly for the current user or returning raw values only otherwise;
my workaround is to use {rowid} to fetch readonly content + dbjoin labels from the database directly.
This is not nice but working.

Other possibilities (as mentioned in our Skype conversation: $groups, $_POST, $formModel->formData, $data, $row) are undefined, empty or don't contain the readonly data/labels.

Additional strange behaviour:
if deleting a record via list view it is also calling the form's php (onDeleteRowsForm) code which - no surprise - doesn't know {rowid} or any other placeholder in this case.
 
Great.
It's working with
Code:
foreach ($data[0][0] as $row){
$x = $row->table___element;
}

This should be in the WIKI but I'm not sure how to do it because this "processing" time is a bit special
1. I think "form submission" (=deletions) is not stopped by returning false?
2. the form's "ondelete" is called also if the records are deleted from the list view (with all checked rows in $data)
What is the difference to list's php-events?
What happens, if both plugins are defined?
 
A bit late responding, but ...

Both plugins - onDeleteRows and onDeleteRowsForm are called at the same point in the list model code, in the deleteRows() method, somewhere around 8790. The only real difference is (at the risk of sounding obvious) one is called for list plugins, one is for form plugins. The distinction is there so Fabrik itself can use the plugin hook either way. So, for example, see the 'article' or 'juser' form plugins for examples of one of our form plugins using onDeleteRowsForm.

If you hang your code on both hooks ... then it's up to you what happens. :)

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top