ObjectController: enforce object only for REST API

refs #11315
This commit is contained in:
Thomas Gelf 2016-03-06 20:24:47 +01:00
parent 6377ed4bc7
commit fd757054e7
1 changed files with 3 additions and 1 deletions

View File

@ -267,7 +267,9 @@ abstract class ObjectController extends ActionController
(int) $id,
$this->db()
);
} else {
} elseif ($this->getRequest()->isApiRequest()) {
$this->getResponse()->setHttpResponseCode(422);
throw new InvalidPropertyException(
'Cannot load object, missing parameters'
);