summaryrefslogtreecommitdiffstats
path: root/library/Icingadb/Web/Controller.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:45:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:45:00 +0000
commitbe4626482ba8761da39746a6ac60d133d3852a0f (patch)
tree45065832c85c4789237e94b3114360eac91d86f0 /library/Icingadb/Web/Controller.php
parentReleasing progress-linux version 1.1.1-1~progress7.99u1. (diff)
downloadicingadb-web-be4626482ba8761da39746a6ac60d133d3852a0f.tar.xz
icingadb-web-be4626482ba8761da39746a6ac60d133d3852a0f.zip
Merging upstream version 1.1.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Icingadb/Web/Controller.php')
-rw-r--r--library/Icingadb/Web/Controller.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php
index ad9f07e..ffa711a 100644
--- a/library/Icingadb/Web/Controller.php
+++ b/library/Icingadb/Web/Controller.php
@@ -307,10 +307,11 @@ class Controller extends CompatController
{
$columns = array_merge($query->getModel()->getSearchColumns(), $additionalColumns);
foreach ($columns as $column) {
- $filter->add(Filter::like(
- $query->getResolver()->qualifyColumn($column, $query->getModel()->getTableName()),
- "*$search*"
- ));
+ if (strpos($column, '.') === false) {
+ $column = $query->getResolver()->qualifyColumn($column, $query->getModel()->getTableName());
+ }
+
+ $filter->add(Filter::like($column, "*$search*"));
}
}
@@ -367,7 +368,10 @@ class Controller extends CompatController
// No matter the format, a limit should only apply if set
if ($this->format !== null) {
- $query->limit(Url::fromRequest()->getParam('limit'));
+ if (! Url::fromRequest()->hasParam('limit')) {
+ $query->limit(null)
+ ->offset(null);
+ }
}
if ($this->format === 'json' || $this->format === 'csv') {
@@ -512,7 +516,12 @@ class Controller extends CompatController
{
parent::preDispatch();
- $this->format = $this->params->shift('format');
+ $this->format = $this->params->shift(
+ 'format',
+ $this->getRequest()->isApiRequest()
+ ? 'json'
+ : null
+ );
}
public function postDispatch()