diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index 334f923..28df320 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -145,6 +145,9 @@ class AppController extends Controller } $this->ACL->checkAccess(); + $version = file_get_contents(ROOT . DS . 'src' . DS . 'VERSION.json'); + $version = json_decode($version, true)['version']; + $this->set('cerebrate_version', $version); if (!$this->ParamHandler->isRest()) { $this->set('ajax', $this->request->is('ajax')); $this->request->getParam('prefix'); diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index 02e3acb..9660d58 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -15,8 +15,10 @@ use Cake\Database\Expression\QueryExpression; use Cake\Routing\Router; use Cake\Http\Exception\MethodNotAllowedException; use Cake\Http\Exception\NotFoundException; +use Cake\Http\Exception\BadRequestException; use Cake\Collection\Collection; use App\Utility\UI\IndexSetting; +use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag; class CRUDComponent extends Component { @@ -703,6 +705,9 @@ class CRUDComponent extends Component private function __massageInput($params) { $input = $this->request->getData(); + if (empty($input)) { + throw new BadRequestException(__('Invalid request content. Please make sure that you pass the data to be handled in the body and that the proper Accept and Content-type headers are set. This could also be caused by invalid JSON data being passed.')); + } if (!empty($params['override'])) { foreach ($params['override'] as $field => $value) { $input[$field] = $value; diff --git a/src/VERSION.json b/src/VERSION.json index 3fd4db5..d14f978 100644 --- a/src/VERSION.json +++ b/src/VERSION.json @@ -1,4 +1,4 @@ { - "version": "1.23", + "version": "1.24", "application": "Cerebrate" } diff --git a/templates/element/layouts/header/header-right.php b/templates/element/layouts/header/header-right.php index 92686c6..34a83d1 100644 --- a/templates/element/layouts/header/header-right.php +++ b/templates/element/layouts/header/header-right.php @@ -1,4 +1,7 @@