Home » Database » DB_DataObject_FormBuilder » Bug #3111
Crosslink tables are not deleted when linked elements are deleted
Details
| Submitted | 2005-01-05 16:28 UTC |
|---|---|
| From | abarrei at gmail dot com |
| Assigned | justinpatrin |
| Status | Bogus |
| Package | DB_DataObject_FormBuilder |
| PHP Version | 4.3.8 |
| OS | Linux Debian Woody |
| Roadmaps | (Not assigned) |
Comments
[2005-01-05 16:28 UTC] abarrei at gmail dot com
Description:
------------
$Id: QuickForm.php,v 1.25
$Id: FormBuilder.php,v 1.102
I am using the last CVS version. First of all, nice package, I love using it, I love instancing it, I love how it is coded and modularized :)
I started using crosslinks tables, I also used the CVS feature extra_field and works great, the only think I noticed, is that when you delete a linked element from a table, the records on the crosslink tables that link that element are not deleted, I think this might be usefull to have it as a default behaviour. Perhaps It was made like this for some special reason and I missed it, if so, dont consider me :) Of course I put the code on the delete handler of my DO to accomplish this, but I thought it worth the post.
[2005-01-05 20:15 UTC] abarrei at gmail dot com
Yes sure, what I meant was:
Persons table
Group table
Persons_Group table
You link one person to one or more groups, and then if you delete some specific person or some specific group, the links of that person or the links of that group in the Persons_group table should be alse be deleted, shouldn't be?
[2005-01-05 21:23 UTC] abarrei at gmail dot com
Yeah, that's what I did (delete method on my DO).
But I am not sure if this is outside the scope of FB. When you uncheck or unlink, lets say a group from a person, FB actually deletes the record from the links table. Anyway, you are right about cascade delete is in most cases handled by the database. I am using mysql but not InnoDB. Delete method works ok for me. I saw in FB's wiki page that cascade delete was one of the "future features", usefull in databases where that feature isn't available. If that feature is added some time in the future, it will probably include crosslink deletions :)
Thanks.
Greetings from Argentina.