When a slot is removed from a template that is used by a content item, it looks like the relationships are not removed. Is there a way to fix that or a way to call something to clear the relationships?
You are correct; removing the Slot does not remove the Relationships.
Currently, we do not have a tool to clean up these Relationships. Usually, we recommend removing the Relationships manually before removing the Slot. Even if you do not, the Relationships should not cause a problem.
Is there a reason you want to clean them up?
Yes, we are using the getItemSlots method of the PSORelationshipTools class in the PSO toolkit in order to get all the associated content items associated. We publish to XML and basically have an array with all of the snippets associated with a content item. There is a .Net front-end which loops through these and puts them on the appropriate place on the page. We would like to get only those snippets which should actually be associated.
This came down to deciding to do something a better way after the original relationships were created, so this should not be an issue in this case. However I have concerns with future development efforts against a productions system when we say, redesign some templates. Going through each content item that will be affected could be a bit cumbersome. I really think this is an issue between the system and the PSOToolkit.
However, is there a reason that this should not be cleaned up and phantom data is left in the system? (Comparing Revisions?)
Another reason for removing the relationship just came to mind. Take the following scenario for example:
[li]You have a left column on a page(content item with a page template) which contains those kinds of things you might put in a left column of a page.
[/li][li]The business decides that type of page should no longer have a left column so the page template is updated an the slot is removed.
[/li][li]There is another business rule which states an item cannot be moved to the archive state unless the item has no dependancies. (Thus making sure the content editors, who are not technical but subject matter experts of the content, cannot remove an item from the system and leave multiple pages with a large blank hole)
In this case there would never be a way to archive any items which have ever been added to the left column of the page which no longer has a template which has an association with that slot.