Closed jaysson closed 1 year ago
Hi @jaysson have same issue, when Publishing, Draft becomes published, but is not current, and old revision becomes, current and marked as published :/
Yeah, something's definitely not right. Will take a look, thanks :slightly_smiling_face:
Hi @oddvalue
I think the problem is here:
public function setLive(): void
{
$published = $this->revisions()->excludeRevision($this)->published()->first();
If I'm editing a draft and call ->publish()
it will exclude it and get the previous (currently published) and mark it as current.
So prevous published record always becomes current and published.
Right, been through it all and found a bug in the separation of the Publishes
and HasDrafts
traits. The Publishes
trait was setting the is_published
column to true on the record that the publish
method was called on. I've moved things around to prevent that and added @jaysson's test.
Use v1.0.2 and you should be good to go :slightly_smiling_face:
Hello, thank you for your work on this library.
Here's a failing test, which I thought would pass:
If this is the expected behaviour, how do I get only the latest published instances?