mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Some minor 1-line tweaks to various files
This commit is contained in:
@@ -244,6 +244,8 @@ class DatabaseQuerySelectFulltext extends Wire {
|
|||||||
//$a = preg_split('/[-\s,+*!.?()=;]+/', $value);
|
//$a = preg_split('/[-\s,+*!.?()=;]+/', $value);
|
||||||
$a = preg_split('/[-\s,+*!?()=;]+/', $value);
|
$a = preg_split('/[-\s,+*!?()=;]+/', $value);
|
||||||
foreach($a as $k => $v) {
|
foreach($a as $k => $v) {
|
||||||
|
$v = trim($v);
|
||||||
|
if(!strlen($v)) continue;
|
||||||
if(DatabaseStopwords::has($v)) {
|
if(DatabaseStopwords::has($v)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -428,7 +428,7 @@ class PagesEditor extends Wire {
|
|||||||
$page->removeStatus(Page::statusUnpublished);
|
$page->removeStatus(Page::statusUnpublished);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($page->parentPrevious) {
|
if($page->parentPrevious && !$isNew) {
|
||||||
if($page->isTrash() && !$page->parentPrevious->isTrash()) {
|
if($page->isTrash() && !$page->parentPrevious->isTrash()) {
|
||||||
$this->pages->trash($page, false);
|
$this->pages->trash($page, false);
|
||||||
} else if($page->parentPrevious->isTrash() && !$page->parent->isTrash()) {
|
} else if($page->parentPrevious->isTrash() && !$page->parent->isTrash()) {
|
||||||
|
@@ -42,7 +42,7 @@ class PagesTrash extends Wire {
|
|||||||
public function trash(Page $page, $save = true) {
|
public function trash(Page $page, $save = true) {
|
||||||
|
|
||||||
if(!$this->pages->isDeleteable($page) || $page->template->noTrash) {
|
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)) {
|
if(!$trash = $this->pages->get($this->config->trashPageID)) {
|
||||||
|
Reference in New Issue
Block a user