mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Fix issue processwire/processwire-issues#1771
This commit is contained in:
@@ -826,7 +826,7 @@ class Pages extends Wire {
|
||||
* - `uncacheAll` (boolean): Whether the memory cache should be cleared (default=true).
|
||||
* - `resetTrackChanges` (boolean): Whether the page's change tracking should be reset (default=true).
|
||||
* - `quiet` (boolean): When true, modified date and modified_users_id won't be updated (default=false).
|
||||
* - `adjustName` (boolean): Adjust page name to ensure it is unique within its parent (default=false).
|
||||
* - `adjustName` (boolean): Adjust page name to ensure it is unique within its parent (default=true).
|
||||
* - `forceID` (integer): Use this ID instead of an auto-assigned one (new page) or current ID (existing page).
|
||||
* - `ignoreFamily` (boolean): Bypass check of allowed family/parent settings when saving (default=false).
|
||||
* - `noHooks` (boolean): Prevent before/after save hooks (default=false), please also use $pages->___save() for call.
|
||||
@@ -2594,5 +2594,3 @@ class Pages extends Wire {
|
||||
public function ___savedPageOrField(Page $page, array $changes = array()) { }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -419,7 +419,7 @@ class PagesEditor extends Wire {
|
||||
* - `uncacheAll` (boolean): Whether the memory cache should be cleared (default=true)
|
||||
* - `resetTrackChanges` (boolean): Whether the page's change tracking should be reset (default=true)
|
||||
* - `quiet` (boolean): When true, created/modified time+user will use values from $page rather than current user+time (default=false)
|
||||
* - `adjustName` (boolean): Adjust page name to ensure it is unique within its parent (default=false)
|
||||
* - `adjustName` (boolean): Adjust page name to ensure it is unique within its parent (default=true)
|
||||
* - `forceID` (integer): Use this ID instead of an auto-assigned on (new page) or current ID (existing page)
|
||||
* - `ignoreFamily` (boolean): Bypass check of allowed family/parent settings when saving (default=false)
|
||||
* - `noHooks` (boolean): Prevent before/after save hooks from being called (default=false)
|
||||
@@ -433,7 +433,7 @@ class PagesEditor extends Wire {
|
||||
$defaultOptions = array(
|
||||
'uncacheAll' => true,
|
||||
'resetTrackChanges' => true,
|
||||
'adjustName' => false,
|
||||
'adjustName' => true,
|
||||
'forceID' => 0,
|
||||
'ignoreFamily' => false,
|
||||
'noHooks' => false,
|
||||
@@ -473,7 +473,7 @@ class PagesEditor extends Wire {
|
||||
}
|
||||
}
|
||||
|
||||
$this->pages->names()->checkNameConflicts($page);
|
||||
if($options['adjustName']) $this->pages->names()->checkNameConflicts($page);
|
||||
if(!$this->savePageQuery($page, $options)) return false;
|
||||
$result = $this->savePageFinish($page, $isNew, $options);
|
||||
if($language) $user->language = $language; // restore language
|
||||
|
@@ -443,7 +443,7 @@ class PagesType extends Wire implements \IteratorAggregate, \Countable {
|
||||
*/
|
||||
public function ___save(Page $page) {
|
||||
if(!$this->isValid($page)) throw new WireException($this->errors('first'));
|
||||
return $this->wire('pages')->save($page);
|
||||
return $this->wire()->pages->save($page, array('adjustName' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user