[SOLVED] Deleting Joined Records

Status
Not open for further replies.

joomlamate

Member
Hey guys, I am looking for some input on the following scenario:

Having 2 tables : Records_Table and Categories_Table.

Records_Table have a db join element to assign the records to one of the categories of the Categories_Table.

Users can add, edit categories. But we want also to give them option to delete categories, if they find that a category should be deleted.

Giving delete access to the users is critical. Mistakes can happen.

The question is how Fabrik will treat the deletion of category that shouldn't be deleted and that has many records linked to it from the other the Records_Table?
 
You can add the canDeleteRow list plugin to Categories_Table with a custom code:
... count(*) from records_table where dbjoin= rowid-of-Categories_Table
only delete if ==0
 
Status
Not open for further replies.
Back
Top