From: Dan Brown Date: Tue, 30 Aug 2022 21:12:52 +0000 (+0100) Subject: Fixed lack of url reference updating on book child move X-Git-Tag: v22.09~1^2~21 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/f092c97748ffb9b67f8475b39f8f4f4c29ada0fc Fixed lack of url reference updating on book child move --- 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) {