Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
iglocska committed Aug 29, 2024
2 parents 52e80af + de39176 commit eb3f725
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public function beforeFilter(EventInterface $event)
}

$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');
Expand Down
5 changes: 5 additions & 0 deletions src/Controller/Component/CRUDComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
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
{
Expand Down Expand Up @@ -703,6 +705,9 @@ public function massageMetaFields($entity, $input, $allMetaTemplates = [], &$cle
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;
Expand Down
2 changes: 1 addition & 1 deletion src/VERSION.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.23",
"version": "1.24",
"application": "Cerebrate"
}
3 changes: 3 additions & 0 deletions templates/element/layouts/header/header-right.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="d-flex">
<div class="global-search-container d-md-block d-none me-4">
<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>
</div>
<div class="global-search-container d-md-block d-none">
<span class="search-input-container">
<input type="text" class="form-control d-inline-block" id="globalSearch" placeholder="<?= __('Search in Cerebrate...') ?>">
Expand Down

0 comments on commit eb3f725

Please sign in to comment.