Forum OpenACS Development: Response to content_revision deleting

Collapse
Posted by Dave Bauer on
OK, I was wrong. I can delete a regular content_item, but not a static_page. It gives me the same error as before:

openacs-4-test=> select * from static_pages;
 static_page_id |       filename        | folder_id | show_comments_p
----------------+-----------------------+-----------+-----------------
           2388 | /static1.html         |      2387 | t
           2391 | /static1/static1.html |      2390 | t
(2 rows)

openacs-4-test=> select static_page__delete(2391);
NOTICE:  ***Deleting id:2391
NOTICE:  *** Number of rows deleted: 1
NOTICE:  *** selected 0 rows still in static_pages
NOTICE:  Deleting symlinks...
NOTICE:  Unscheduling item...
NOTICE:  Deleting associated revisions...
NOTICE:  Deleting associated item templates...
NOTICE:  Deleting item relationships...
NOTICE:  Deleting child relationships...
NOTICE:  Deleting parent relationships...
NOTICE:  Deleting associated permissions...
NOTICE:  Deleting keyword associations...
NOTICE:  Deleting associated comments...
NOTICE:  identifier "journal_entry__delete_for_object" will be truncated to "journal_entry__delete_for_objec"
NOTICE:  Deleting content item...
ERROR:  Referential Integrity: attempting to delete live_revision: 2392
If I use content_item__delete(2391) I get the exact same output. I created a generic content_item with content_item__new and created a live revision. The content_item and revision were deleted without error using content_item__delete. I can't think of where else to look. There is a constrainst on cr_revisions that will not allow a revision to be deleted if it is referred in the live_revision of latest_revision column of cr_items.