david at justatheory
Jan 27, 2012, 3:42 PM
Post #2 of 3
On Jan 27, 2012, at 3:31 PM, Matthew Rolf wrote:
Re: Managing changes to keywords in stories
[In reply to]
> 1. If a user deletes a keyword in the interface, it is removed from all the stories that it is on. That is, if you "check out" one of these stories, the keyword no longer appears to be associated. But it actually still is. If you do a story->list for stories with the deleted keyword, the stories still come up in the list even though its been deleted.
> 2. If a user tries to add a deleted keyword to a story, they get an error that keyword "already exists".
Bug. Should probably re-activated the keyword.
> 3. If a keyword gets re-activated via $keyword->activate, the keywords are displayed again on all the old stories. So the deleted keywords are still associated with the stories, you just cant see them.
Right. One should filter out inactive keywords in templates. I always forget about that.
> 4. If we delete a keyword cover page (as describe in Philip's thread), and then try to re-publish a blog entry with that keyword, the template BLOWS up. I assume this is because that story is deactivated, it is not available via the API when it checks if it exists, but the template dies because it can not reuse the URI.
Dunno, but seems like the sort of thing you could code around in the template.
> My question is this: are the above scenarios how Bricolage *should* handle the problem? If not, what would be a better way? I think you can make an argument that #2 and #3 are perhaps not a bad behavior. I'm less certain about #1. In regards to #4, I think there's an open question of how something like that should be handled - automatically recreate the story, leave it alone, or prompt the user? Is there a reasonable way to check a deleted story and notify the user via the API or just regenerate?
You canít prompt the user from a template, really. I would probably just re-generate, me. But it depends on the requirements in your environment.
> Finally, there's the question of deleting keyword pages along with keywords that get deleted. I personally think that would be a "useful" thing, but I'm not sure how we could accomplish it at the moment.
Yeah, they are independent things. Theoretically, one could do it with event hooks, but they've never been implemented.