Forum OpenACS Q&A: Re: Delete Subsite Error

Collapse
5: Re: Delete Subsite Error (response to 1)
Posted by Dave Bauer on
What packages are in your subsite.

Each package is responsible to clean up after itself on delete. There is an APM callback that should be implemented.

So if you can tell us which packages are a problem and can't be deleted, it would hopefully lead to improvements to these packages.

In generaly to do this in the database you'd need to, at a minimum,

Call acs_object__delete() for every object that has the package_id in question as a foreign key in the acs_objects table.

If you are lucky that will completely delete all references to the object. If the object specific storage table has other foreign keys without on delete cascade, you'd have to track those down as well.

Collapse
Posted by Iuri Sampaio on
No Dave, i'm able to delete the pkg and the subsite as well.

On each subsite i installed only "edit-this-page pkg". But i believe the problems are on the references of that, which i don't know where they are located.

Because I "unmounted" and "deleted" edit-this-page on each subsite and after i "delete" the subsite. Then i create a new subsite with the same name and url, and install the edit-this-page aplication with the same name.

I did that because i created a structure of subsites but then i realised that i missed one level. then i had to re-built again. So, i just did the same process with the same names, in order to get rid of the problem, but then the bug show up.

however i'm concerned the pkg-keys are unique for each instance, even if you uninstall and install another with the same names, the new one will receive a different pkg-key.
So it means the references haven't been deleted of the system.

Collapse
Posted by Iuri Sampaio on
By the way,
I found a link that takes me to unmounted packages. there i found all the packages i had unmounted and deleted, But they are stills there. Why?
Futhermore, i tried to delete them and i got this error message:

Error Deleting Instance
/ home / yabt / yabt / packages / dotlrn / www / dotlrn-master-kelp
The following error was returned:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: update or delete on "apm_packages" violates foreign key constraint "cr_fldr_pkg_id_fk" on "cr_folders"
DETAIL: Key (package_id)=(197967) is still referenced from table "cr_folders".

SQL:
select apm_package__delete('197967');