- changed status to open
Committees cannot really be deleted
Issue #74
resolved
The problem is that committees are linked to calendar events and pages and possibly other things, therefore simply deleting them from the DB will cause all kinds of cascades that we do not want.
Thus, we need to implement yet another form of hiding. Currently "committees" like the board are hidden, but we also need a way to deactivate committees, and possibly to reactivate them.
Another option is to just hide committees that are empty from all indexes except for the board in a special list, so they can reactivate them when necessary.
https://sentry.svcover.nl/cover/cover-php/issues/114/
PDOException: SQLSTATE[23503]: Foreign key violation: 7 ERROR: update or delete on table "commissies" violates foreign key constraint "agenda_committee_id_fkey" on table "agenda"
DETAIL: Key (id)=(15) is still referenced from table "agenda".
File "include/data/DatabasePDO.php", line 92, in execute
$statement->execute($input_parameters);
File "include/data/DatabasePDO.php", line 92, in query
$statement->execute($input_parameters);
File "include/data/DatabasePDO.php", line 362, in delete
$this->query('DELETE FROM "' . $table . '" WHERE ' . $condition);
File "include/data/DataModel.php", line 194, in _delete
return $this->db->delete($table, $this->_id_string($iter->get_id(), $table));
File "include/data/DataModel.php", line 208, in delete
return $this->_delete($this->table, $iter);
...
(7 additional frame(s) were not displayed)
Comments (2)
-
reporter -
reporter - changed status to resolved
- Log in to comment
I'm working on this. I've implemented this by making currently hidden "committees" such as the board and the KISO a third type of committee that isn't really hidden but just doesn't show up in the indexes like the committee page. The 'hidden' field in the database is then used for deactivating/deleting committees.
In the committee edit form the delete button has been replaced by a deactivate button. Deactivating a committee will remove all its members and mark it as hidden. In the newly added archive page a committee can be re-activated by removing the "hidden" flag.