
david at kineticode
Feb 5, 2009, 10:18 AM
Views: 6817
Permalink
|
On Feb 4, 2009, at 1:42 PM, Matthew Rolf wrote: >> That's crazy. Is this 1.11? That would help to explain it… > > Nope, it's in 1.10.x, if not before. Take a look at the desk > interface. Okay. >>> Story Checked In 2008-04-07 20:51:11 Version: 5 >> >> Clearly wrong. So I wonder if that last checkout copied v4 instead >> of v6? > > FWIW, the id of v4 is 52324, which puts it appropriately before v.5. Yeah, but the query doesn't sort by log dates when it looks for a story to check out (or check in). >> Then, a long time later, the story was checked in…and the version >> was set to 5 instead of 7. WTF? >> >> So, what we've figured out is that this tends to happen when a user >> has a story checked out for a long time, and, maybe, that there >> were publishes while it was checked out. Yes? > > That's definitely Philip and Scott's experience, and I don't > discount it, but I can't say that's been ours. Look at the log > again - the entire bit of going to v5-v6-v5 takes place within a > half hour. So this story didn't sit for a while. Okay. Scratch that idea, then. Good to have one less variable to worry about. > I have 2 theories - 1) the session data regarding versions got > borked (or was cached?) and failed to be aware of the fact that it > had v6, checking it in as something else, or 2) The check in hadn't > completed before the checkout occurred, resulting in corruption. Yeah, good working hypotheses. If the session had the story with version 4 instead of 6, then it would try to check it in as version 5. That'd be my first guess. The "checkin hadn't completed" bit shouldn't be the case, thanks to transactions, but it's possible that there could be a couple of transactions on checkin. Still, the bit that determines the new version number should not be confused. I think the session issue is much more likely the culprit. >> Is there a bug report for this? I don't really have time to fiddle >> with it right now, but we should add this info to a bug report. > > I'll be happy to make a bug report. I was poking around > > http://svn.bricolage.cc/bricolage/trunk/lib/Bric/Biz/Asset/Business/Story.pm > > And saw the somewhat cryptic checkout subroutine, but didn't see > anything for check in. Where would I look for that code? Like Scott said. :-) Try sticking in this code and watching your log the next time this happens: Index: Asset.pm =================================================================== --- Asset.pm (revision 8400) +++ Asset.pm (working copy) @@ -1723,6 +1723,8 @@ my $version = $self->_get('version'); $version++; + print STDERR 'Story ID ', $self->get_id, ' going from version ', + $self->get_version, " to $version\n"; $self->_set({ user__id => undef, version => $version, current_version => $version, Best, David
|