From f092c97748ffb9b67f8475b39f8f4f4c29ada0fc Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 30 Aug 2022 22:12:52 +0100 Subject: [PATCH] Fixed lack of url reference updating on book child move --- app/Entities/Models/BookChild.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) {