
david at kineticode
May 7, 2009, 9:41 AM
Post #2 of 3
(666 views)
Permalink
|
|
Re: allowed_desks error, cannot edit story
[In reply to]
|
|
On May 5, 2009, at 7:22 AM, Ashlee Caul wrote: > Hi. I have a story that is not checked out, but Bric says I do have > it checked out. If I click on the "Edit" link to edit the story, I > get this error: > > Can't call method "allowed_desks" on an undefined value at /usr/ > local/bricolage/comp/widgets/story_prof/edit_meta.html line 342, > <GEN211> line 165. > > This seems like a workflow error. I looked at the story table in > Postgres, and there was a 0 in the workflow__id column for this > story. I also see that there is a workflow_member table in Postgres, > but I don't want to mess around with too much stuff. What might I do > to unlock this story so I can check it out, edit it, and publish it > again? Thanks. Okay, the other half of checking assets out is putting them in asset groups that stand for workflows and desks. At least that's the theory; at the moment, I can't find where they are put into workflow desks, although I'm sure that they are. Anyway, I believe that you can see which stories are broken by running this query: SELECT sm.id, s.primary_uri FROM story_member sm JOIN story s ON s.id = sm.object_id JOIN member m ON sm.member__id = m.id WHERE s.desk__id = 0 AND m.grp__id IN ( SELECT asset_grp FROM desk ) ; If you want to clean them out, you just do this: DELETE FROM member WHERE id IN ( SELECT m.id FROM story_member sm JOIN story s ON s.id = sm.object_id JOIN member m ON sm.member__id = m.id WHERE s.desk__id = 0 AND m.grp__id IN ( SELECT asset_grp FROM desk ) ); But do be sure that the story is checked in! If you have this problem with a template or media document, just change "story" to "media" or "template" in the above queries. Best, David
|