mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Fix issue processwire/processwire-issues#1533
This commit is contained in:
@@ -1876,12 +1876,16 @@ class PagesEditor extends Wire {
|
|||||||
if($template) $options['template'] = $template;
|
if($template) $options['template'] = $template;
|
||||||
if($class) $options['pageClass'] = $class;
|
if($class) $options['pageClass'] = $class;
|
||||||
|
|
||||||
if(isset($options['id']) && ctype_digit("$options[id]") && (int) $options['id'] > 0) {
|
if(isset($options['id'])) {
|
||||||
|
if(ctype_digit("$options[id]") && (int) $options['id'] > 0) {
|
||||||
$options['id'] = (int) $options['id'];
|
$options['id'] = (int) $options['id'];
|
||||||
if($parent && "$options[id]" === "$parent") unset($options['parent']);
|
if($parent && "$options[id]" === "$parent") unset($options['parent']);
|
||||||
|
} else if(((int) $options['id']) === -1) {
|
||||||
|
$options['id'] = (int) $options['id']; // special case allowed for access control tests
|
||||||
} else {
|
} else {
|
||||||
unset($options['id']);
|
unset($options['id']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user