1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 00:37:02 +02:00

Some minor 1-line tweaks to various files

This commit is contained in:
Ryan Cramer
2019-01-25 11:32:47 -05:00
parent 411cce0418
commit 02f9220529
4 changed files with 5 additions and 3 deletions

View File

@@ -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;
}

View File

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

View File

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