Skip to content

NOW MANAGED ON CODEBERG

Fixed lack of url reference updating on book child move

Dan Brownf092c97748ff
diff --git a/app/Entities/Models/BookChild.php b/app/Entities/Models/BookChild.php
index 3b1ac1bab..ed08f16e6 100644
--- a/app/Entities/Models/BookChild.php
+++ b/app/Entities/Models/BookChild.php
@@ -62,13 +62,12 @@ abstract class BookChild extends Entity
$this->book_id = $newBookId;
$this->refreshSlug();
$this->save();
+ $this->refresh();
if ($oldUrl !== $this->getUrl()) {
app()->make(ReferenceUpdater::class)->updateEntityPageReferences($this, $oldUrl);
}
- $this->refresh();
-
// Update all child pages if a chapter
if ($this instanceof Chapter) {
foreach ($this->pages()->withTrashed()->get() as $page) {