diff --git a/site-languages/templates/_main.php b/site-languages/templates/_main.php index f4810aeb..fc5df658 100644 --- a/site-languages/templates/_main.php +++ b/site-languages/templates/_main.php @@ -106,7 +106,7 @@
diff --git a/wire/core/DatabaseQuerySelectFulltext.php b/wire/core/DatabaseQuerySelectFulltext.php index cbecb39a..5d23a9a4 100644 --- a/wire/core/DatabaseQuerySelectFulltext.php +++ b/wire/core/DatabaseQuerySelectFulltext.php @@ -244,6 +244,8 @@ class DatabaseQuerySelectFulltext extends Wire { //$a = preg_split('/[-\s,+*!.?()=;]+/', $value); $a = preg_split('/[-\s,+*!?()=;]+/', $value); foreach($a as $k => $v) { + $v = trim($v); + if(!strlen($v)) continue; if(DatabaseStopwords::has($v)) { continue; } diff --git a/wire/core/PagesEditor.php b/wire/core/PagesEditor.php index 12281256..488afd7d 100644 --- a/wire/core/PagesEditor.php +++ b/wire/core/PagesEditor.php @@ -428,7 +428,7 @@ class PagesEditor extends Wire { $page->removeStatus(Page::statusUnpublished); } - if($page->parentPrevious) { + if($page->parentPrevious && !$isNew) { if($page->isTrash() && !$page->parentPrevious->isTrash()) { $this->pages->trash($page, false); } else if($page->parentPrevious->isTrash() && !$page->parent->isTrash()) { diff --git a/wire/core/PagesTrash.php b/wire/core/PagesTrash.php index 0d40845d..8b284951 100644 --- a/wire/core/PagesTrash.php +++ b/wire/core/PagesTrash.php @@ -42,7 +42,7 @@ class PagesTrash extends Wire { public function trash(Page $page, $save = true) { if(!$this->pages->isDeleteable($page) || $page->template->noTrash) { - throw new WireException("This page may not be placed in the trash"); + throw new WireException("This page (id=$page->id) may not be placed in the trash"); } if(!$trash = $this->pages->get($this->config->trashPageID)) {