Closed (fixed)
Project:
State Machine
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2015 at 08:20 UTC
Updated:
17 Oct 2015 at 08:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
paranojik commentedThis patch tries to fix the isDraftRevision() method.
Comment #3
paranojik commentedThe previous patch broke a couple of test by not properly determining the "unpublished" state.
New patch attached. Big thanks to @das-peter for suggesting this solution.
Comment #4
das-peter commentedThanks, looks pretty good :) All current tests pass. However, may I ask you to create new tests that would fail with the unpatched module version?
Comment #5
LittleRedHen commentedThanks for this! I was struggling with the new-draft-of-published-content thing as well, when the second save on a new draft (such as to submit it for approval) was un-publishing the old published version. My minimal testing so far indicates that the patch in #3 corrects that.
I do notice, though, is that the state information which appears on the node-view page for users with sufficient privileges still says
, even when there is a newer draft. So it looks like the $state_machine->get_latest_revision() may not be correct now. I will look into that further, but the patch in #3 certainly helps.
Comment #6
das-peter commented@LittleRedHen Thanks for the feedback, much appreciated!
Comment #7
paranojik commentedAdded test for the "Editing a draft" case. I'm not able to reproduce the "New node" case anymore. Maybe that was a product of my imagination...
Comment #9
das-peter commentedSeems to work beautifully and the test fails without patched code - perfect :)
Thanks!