Merge branch 'develop'

pull/101/head v1.6
iglocska 2022-06-09 14:14:43 +02:00
commit b5d9d6bb6b
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
8 changed files with 32 additions and 24 deletions

View File

@ -25,7 +25,7 @@
"league/openapi-psr7-validator": "^0.17", "league/openapi-psr7-validator": "^0.17",
"phpunit/phpunit": "^8.5", "phpunit/phpunit": "^8.5",
"psy/psysh": "@stable", "psy/psysh": "@stable",
"wiremock-php/wiremock-php": "^2.32" "wiremock-php/wiremock-php": "^2.33"
}, },
"suggest": { "suggest": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.", "markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",

View File

@ -37,6 +37,7 @@ use Cake\Core\Configure\Engine\PhpConfig;
use Cake\Datasource\ConnectionManager; use Cake\Datasource\ConnectionManager;
use Cake\Error\ConsoleErrorHandler; use Cake\Error\ConsoleErrorHandler;
use Cake\Error\ErrorHandler; use Cake\Error\ErrorHandler;
use Cake\Filesystem\File;
use Cake\Http\ServerRequest; use Cake\Http\ServerRequest;
use Cake\Log\Log; use Cake\Log\Log;
use Cake\Mailer\Mailer; use Cake\Mailer\Mailer;
@ -88,10 +89,13 @@ try {
if (file_exists(CONFIG . 'app_local.php')) { if (file_exists(CONFIG . 'app_local.php')) {
Configure::load('app_local', 'default'); Configure::load('app_local', 'default');
//Configure::load('cerebrate', 'default', true); //Configure::load('cerebrate', 'default', true);
$settings = file_get_contents(CONFIG . 'config.json'); $settingsFile = new File(CONFIG . 'config.json');
$settings = json_decode($settings, true); if ($settingsFile->exists()) {
foreach ($settings as $path => $setting) { $settings = file_get_contents(CONFIG . 'config.json');
Configure::write($path, $setting); $settings = json_decode($settings, true);
foreach ($settings as $path => $setting) {
Configure::write($path, $setting);
}
} }
} }

View File

@ -1480,6 +1480,7 @@ class CRUDComponent extends Component
} }
return $query->select([$field]) return $query->select([$field])
->distinct() ->distinct()
->all()
->extract($fieldToExtract) ->extract($fieldToExtract)
->toList(); ->toList();
} }

View File

@ -6,6 +6,8 @@ use App\Controller\AppController;
use Cake\Utility\Hash; use Cake\Utility\Hash;
use Cake\Utility\Text; use Cake\Utility\Text;
use \Cake\Database\Expression\QueryExpression; use \Cake\Database\Expression\QueryExpression;
use Cake\Http\Exception\NotFoundException;
use Cake\Http\Exception\MethodNotAllowedException;
class LocalToolsController extends AppController class LocalToolsController extends AppController
{ {
@ -110,6 +112,9 @@ class LocalToolsController extends AppController
$actionDetails = $this->LocalTools->getActionDetails($actionName); $actionDetails = $this->LocalTools->getActionDetails($actionName);
$params['connection'] = $connection; $params['connection'] = $connection;
$results = $this->LocalTools->action($this->ACL->getUser()['id'], $connection->connector, $actionName, $params, $this->request); $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'])) { if (!empty($results['redirect'])) {
$this->redirect($results['redirect']); $this->redirect($results['redirect']);
} }

View File

@ -1,4 +1,4 @@
{ {
"version": "1.4", "version": "1.6",
"application": "Cerebrate" "application": "Cerebrate"
} }

View File

@ -209,7 +209,7 @@ class BootstrapGeneric
{ {
$html = ''; $html = '';
foreach ($params as $k => $v) { foreach ($params as $k => $v) {
if (!empty($k) && !empty($v)) { if (!empty($k) && (isset($v) && $v !== '')) {
$html .= BootstrapGeneric::genHTMLParam($k, $v) . ' '; $html .= BootstrapGeneric::genHTMLParam($k, $v) . ' ';
} }
} }

View File

@ -39,24 +39,22 @@
var url = $('#view-child-body-<?= h($randomId) ?>').data('content-url'); var url = $('#view-child-body-<?= h($randomId) ?>').data('content-url');
var loadon = $('#view-child-body-<?= h($randomId) ?>').data('load-on'); var loadon = $('#view-child-body-<?= h($randomId) ?>').data('load-on');
if (loadon === 'ready') { if (loadon === 'ready') {
$.ajax({ AJAXApi.quickFetchURL(url, {})
success:function (data, textStatus) { .then((html) => {
$('#view-child-body-<?= h($randomId) ?>').html(data); $('#view-child-body-<?= h($randomId) ?>').html(html);
}, })
type: "get", .catch((err) => {
cache: false, $('#view-child-body-<?= h($randomId) ?>').text(err.message);
url: url, })
});
} else { } else {
$('#view-child-<?= h($randomId) ?>').on('hidden.bs.collapse', function () { $('#view-child-<?= h($randomId) ?>').on('hidden.bs.collapse', function () {
$.ajax({ AJAXApi.quickFetchURL(url, {})
success:function (data, textStatus) { .then((html) => {
$('#view-child-body-<?= h($randomId) ?>').html(data); $('#view-child-body-<?= h($randomId) ?>').html(html);
}, })
type: "get", .catch((err) => {
cache: false, $('#view-child-body-<?= h($randomId) ?>').text(err.message);
url: url, })
});
}) })
} }
}); });

View File

@ -76,7 +76,7 @@ trait WireMockTestTrait
$headers = $stub->getRequest()->getHeaders(); $headers = $stub->getRequest()->getHeaders();
if (is_array($headers)) { if (is_array($headers)) {
foreach ($headers as $header => $rule) { foreach ($headers as $header => $rule) {
$validator = $validator->withHeader($header, ValueMatchingStrategy::fromArray($rule)); $validator = $validator->withHeader($header, $rule);
} }
} }