Make manage[form] config optional

There are times when manage form mode just isn't needed. This will make the view[list] unclickable, which is OK
This commit is contained in:
Samuel Georges 2016-09-27 16:53:46 +10:00
parent 0b345ad592
commit cd0cd260b5
1 changed files with 4 additions and 1 deletions

View File

@ -795,7 +795,10 @@ class RelationController extends ControllerBehavior
*/
elseif ($this->manageMode == 'form') {
$config = $this->makeConfigForMode('manage', 'form');
if (!$config = $this->makeConfigForMode('manage', 'form', false)) {
return null;
}
$config->model = $this->relationModel;
$config->arrayName = class_basename($this->relationModel);
$config->context = $this->evalFormContext('manage', !!$this->manageId);