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

View File

@ -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) {