Skip to content

Commit eb3f725

Browse files
committed
Merge branch 'develop'
2 parents 52e80af + de39176 commit eb3f725

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/Controller/AppController.php

+3
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ public function beforeFilter(EventInterface $event)
145145
}
146146

147147
$this->ACL->checkAccess();
148+
$version = file_get_contents(ROOT . DS . 'src' . DS . 'VERSION.json');
149+
$version = json_decode($version, true)['version'];
150+
$this->set('cerebrate_version', $version);
148151
if (!$this->ParamHandler->isRest()) {
149152
$this->set('ajax', $this->request->is('ajax'));
150153
$this->request->getParam('prefix');

src/Controller/Component/CRUDComponent.php

+5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
use Cake\Routing\Router;
1616
use Cake\Http\Exception\MethodNotAllowedException;
1717
use Cake\Http\Exception\NotFoundException;
18+
use Cake\Http\Exception\BadRequestException;
1819
use Cake\Collection\Collection;
1920
use App\Utility\UI\IndexSetting;
21+
use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
2022

2123
class CRUDComponent extends Component
2224
{
@@ -703,6 +705,9 @@ public function massageMetaFields($entity, $input, $allMetaTemplates = [], &$cle
703705
private function __massageInput($params)
704706
{
705707
$input = $this->request->getData();
708+
if (empty($input)) {
709+
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.'));
710+
}
706711
if (!empty($params['override'])) {
707712
foreach ($params['override'] as $field => $value) {
708713
$input[$field] = $value;

src/VERSION.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "1.23",
2+
"version": "1.24",
33
"application": "Cerebrate"
44
}

templates/element/layouts/header/header-right.php

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<div class="d-flex">
2+
<div class="global-search-container d-md-block d-none me-4">
3+
<span><a style="text-decoration: none" class="link-light" href="https://cerebrate-project.org">Cerebrate</a> <a style="text-decoration: none" class="link-light" href="https://github.com/cerebrate-project/cerebrate/releases/tag/v<?= h($cerebrate_version) ?>">v<?= h($cerebrate_version) ?></a></span>
4+
</div>
25
<div class="global-search-container d-md-block d-none">
36
<span class="search-input-container">
47
<input type="text" class="form-control d-inline-block" id="globalSearch" placeholder="<?= __('Search in Cerebrate...') ?>">

0 commit comments

Comments
 (0)