Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
iglocska committed Jun 9, 2022
2 parents f513f8e + a8c4296 commit b5d9d6b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"league/openapi-psr7-validator": "^0.17",
"phpunit/phpunit": "^8.5",
"psy/psysh": "@stable",
"wiremock-php/wiremock-php": "^2.32"
"wiremock-php/wiremock-php": "^2.33"
},
"suggest": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
Expand Down
12 changes: 8 additions & 4 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use Cake\Datasource\ConnectionManager;
use Cake\Error\ConsoleErrorHandler;
use Cake\Error\ErrorHandler;
use Cake\Filesystem\File;
use Cake\Http\ServerRequest;
use Cake\Log\Log;
use Cake\Mailer\Mailer;
Expand Down Expand Up @@ -88,10 +89,13 @@
if (file_exists(CONFIG . 'app_local.php')) {
Configure::load('app_local', 'default');
//Configure::load('cerebrate', 'default', true);
$settings = file_get_contents(CONFIG . 'config.json');
$settings = json_decode($settings, true);
foreach ($settings as $path => $setting) {
Configure::write($path, $setting);
$settingsFile = new File(CONFIG . 'config.json');
if ($settingsFile->exists()) {
$settings = file_get_contents(CONFIG . 'config.json');
$settings = json_decode($settings, true);
foreach ($settings as $path => $setting) {
Configure::write($path, $setting);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Controller/Component/CRUDComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ private function getFilteringContextFromField($field)
}
return $query->select([$field])
->distinct()
->all()
->extract($fieldToExtract)
->toList();
}
Expand Down
5 changes: 5 additions & 0 deletions src/Controller/LocalToolsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Cake\Utility\Hash;
use Cake\Utility\Text;
use \Cake\Database\Expression\QueryExpression;
use Cake\Http\Exception\NotFoundException;
use Cake\Http\Exception\MethodNotAllowedException;

class LocalToolsController extends AppController
{
Expand Down Expand Up @@ -110,6 +112,9 @@ public function action($connectionId, $actionName)
$actionDetails = $this->LocalTools->getActionDetails($actionName);
$params['connection'] = $connection;
$results = $this->LocalTools->action($this->ACL->getUser()['id'], $connection->connector, $actionName, $params, $this->request);
if (empty($results)) {
throw new MethodNotAllowedException(__('Could not execute the requested action.'));
}
if (!empty($results['redirect'])) {
$this->redirect($results['redirect']);
}
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.4",
"version": "1.6",
"application": "Cerebrate"
}
2 changes: 1 addition & 1 deletion src/View/Helper/BootstrapHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ protected static function genHTMLParams($params)
{
$html = '';
foreach ($params as $k => $v) {
if (!empty($k) && !empty($v)) {
if (!empty($k) && (isset($v) && $v !== '')) {
$html .= BootstrapGeneric::genHTMLParam($k, $v) . ' ';
}
}
Expand Down
30 changes: 14 additions & 16 deletions templates/element/genericElements/SingleViews/child.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,22 @@
var url = $('#view-child-body-<?= h($randomId) ?>').data('content-url');
var loadon = $('#view-child-body-<?= h($randomId) ?>').data('load-on');
if (loadon === 'ready') {
$.ajax({
success:function (data, textStatus) {
$('#view-child-body-<?= h($randomId) ?>').html(data);
},
type: "get",
cache: false,
url: url,
});
AJAXApi.quickFetchURL(url, {})
.then((html) => {
$('#view-child-body-<?= h($randomId) ?>').html(html);
})
.catch((err) => {
$('#view-child-body-<?= h($randomId) ?>').text(err.message);
})
} else {
$('#view-child-<?= h($randomId) ?>').on('hidden.bs.collapse', function () {
$.ajax({
success:function (data, textStatus) {
$('#view-child-body-<?= h($randomId) ?>').html(data);
},
type: "get",
cache: false,
url: url,
});
AJAXApi.quickFetchURL(url, {})
.then((html) => {
$('#view-child-body-<?= h($randomId) ?>').html(html);
})
.catch((err) => {
$('#view-child-body-<?= h($randomId) ?>').text(err.message);
})
})
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/Helper/WireMockTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function verifyStubCalled(StubMapping $stub): void
$headers = $stub->getRequest()->getHeaders();
if (is_array($headers)) {
foreach ($headers as $header => $rule) {
$validator = $validator->withHeader($header, ValueMatchingStrategy::fromArray($rule));
$validator = $validator->withHeader($header, $rule);
}
}

Expand Down

0 comments on commit b5d9d6b

Please sign in to comment.