0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-07 01:30:06 +00:00

Fixed lack of url reference updating on book child move

This commit is contained in:
Dan Brown 2022-08-30 22:12:52 +01:00
parent 9153be963d
commit f092c97748
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9

View file

@ -62,13 +62,12 @@ abstract class BookChild extends Entity
$this->book_id = $newBookId; $this->book_id = $newBookId;
$this->refreshSlug(); $this->refreshSlug();
$this->save(); $this->save();
$this->refresh();
if ($oldUrl !== $this->getUrl()) { if ($oldUrl !== $this->getUrl()) {
app()->make(ReferenceUpdater::class)->updateEntityPageReferences($this, $oldUrl); app()->make(ReferenceUpdater::class)->updateEntityPageReferences($this, $oldUrl);
} }
$this->refresh();
// Update all child pages if a chapter // Update all child pages if a chapter
if ($this instanceof Chapter) { if ($this instanceof Chapter) {
foreach ($this->pages()->withTrashed()->get() as $page) { foreach ($this->pages()->withTrashed()->get() as $page) {