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

Fix issue processwire/processwire-issues#700 where ProcessPermission "add new" was incorrectly showing Save+Publish buttons

This commit is contained in:
Ryan Cramer
2018-09-20 11:58:20 -04:00
parent 8973a9de49
commit 8add252813

View File

@@ -83,6 +83,20 @@ class ProcessPermission extends ProcessPageType {
}
}
/**
* Get the page editor
*
* @param string $moduleName One of 'ProcessPageEdit' or 'ProcessPageAdd' (or other that extends)
* @return ProcessPageEdit|ProcessPageAdd|WirePageEditor
* @throws WireException If requested editor moduleName not found
*
*/
protected function getEditor($moduleName) {
$editor = parent::getEditor($moduleName);
if($editor == 'ProcessPageAdd') $editor->set('noAutoPublish', true);
return $editor;
}
public function ___executeAdd() {
// hide the title field, since it is counterproductive when adding a new permission