Skip to content

Commit

Permalink
[5.x] Fix wrong blueprint parent after revision publish (#11116)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksleight authored Nov 12, 2024
1 parent 0323f2b commit a0b09e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fields/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function setParent($parent)
{
$this->parent = $parent;

$this->resetFieldsCache();
$this->resetBlueprintCache()->resetFieldsCache();

return $this;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Revisions/Revisable.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public function publishWorkingCopy($options = [])

$item->deleteWorkingCopy();

if ($item instanceof Entry) {
$item->blueprint()->setParent($item);
}

return $item;
}

Expand All @@ -133,6 +137,10 @@ public function unpublishWorkingCopy($options = [])

$item->deleteWorkingCopy();

if ($item instanceof Entry) {
$item->blueprint()->setParent($item);
}

return $item;
}

Expand Down

0 comments on commit a0b09e5

Please sign in to comment.