Skip to content

Commit

Permalink
Error in template selection
Browse files Browse the repository at this point in the history
Using $this->template here is just plain wrong!

You want to use the $name argument here too of course!

Using $this->template breaks custom actions like so:

...$this->Crud->mapAction('account', [
  'className' => 'Crud.Edit',
  'view' => 'edit'
]);

function account() {
  return $this->Crud->execute();
}

If there should be a valid case to use $this->template too, we need another try/catch block i suppose.
  • Loading branch information
hmic authored Aug 30, 2017
1 parent 6f022cc commit bcc1e0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/CrudView.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected function _getViewFileName($name = null)
$this->subDir = null;
$this->templatePath = 'Scaffold';

return parent::_getViewFileName($this->template);
return parent::_getViewFileName($name);
}
}
}

0 comments on commit bcc1e0e

Please sign in to comment.