From 8add252813400753ce5233fd5e62ffaa7c9142dc Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 20 Sep 2018 11:58:20 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#700 where ProcessPermission "add new" was incorrectly showing Save+Publish buttons --- .../ProcessPermission/ProcessPermission.module | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wire/modules/Process/ProcessPermission/ProcessPermission.module b/wire/modules/Process/ProcessPermission/ProcessPermission.module index 6c4bf561..49936dfb 100644 --- a/wire/modules/Process/ProcessPermission/ProcessPermission.module +++ b/wire/modules/Process/ProcessPermission/ProcessPermission.module @@ -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