Skip to content

Commit

Permalink
fix: fix createPage resetting title
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Dec 27, 2023
1 parent 6f3d17c commit 07b0655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RockMigrations.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ public function createPage(
bool $allLanguages = true
) {
// create pagename from page title if it is not set
if (!$name) $name = $this->sanitizer->pageNameTranslate($title);
if (!$name && $title) $name = $this->sanitizer->pageNameTranslate($title);
if (!$name) $name = $this->wire->pages->names()->uniquePageName();

$parentName = $parent;
Expand Down Expand Up @@ -2868,7 +2868,7 @@ public function migrate($config)
/** @var WireData $d */
$d->setArray($data);
$this->createPage(
title: $d->title ?: $name,
title: $d->title,
name: $name,
template: $d->template,
parent: $d->parent,
Expand Down

0 comments on commit 07b0655

Please sign in to comment.