When exporting JSON with a limit and a page > 1 set, a leading comma is added
before the first item because `$offset !== 0` evaluates to true, resulting in
invalid JSON.
Replace the offset‑based condition with a `$first` flag to track whether any
item has been written yet.
(cherry picked from commit b60448bc77)
Add explicit return types to `ipl-orm`-derived methods to prepare for strict
typing. These additions are safe, as they only annotate existing methods that
previously lacked return type declarations.
(cherry picked from commit f8d4f92566)
2cd1f96c Fixes that a condition, to keep redundancy groups in the result
(as they cannot be subjected to restrictions), lead to expensive and
irrelevant sub-queries in cases where redundancy groups were not
fetched. (e.g. usergroups)
6cb15efc Changes restriction application so that restrictions of
multiple roles are merged together instead of being processed
individually. This helps the ORM to generate less sub-queries and I
suspect performance will also be improved, even if just slightly.
fixes#1294
(cherry picked from commit 3b77b1c956)
This hook usually runs isolated and no-one else requires a connection.
Makes only a difference in case of reporting triggering this as part
of a scheduled report and prevents the database connection from being
left open unnecessarily and failing upon re-use.
(cherry picked from commit e56d8a68ca)
Still hacky, but at least the combined str_replace
should compensate the preg_replace :D
I stopped thinking about a proper fix, as between the
time the original quick fix was implemented and now,
nothing has fundamentally changed in ipl-orm.
fixes#1330
(cherry picked from commit ab5304d4b0)
Previously, only the second and other subsequent item was updated with redis
results. Not sure why this wasn't discovered until recently, as the issue
was already part of the initial fix meant for a very similar issue, affecting
*all* items. Hell, maybe because my initial analysis this time also led me
into the wrong direction, so when reviewing this, proper testing and result
verification is key!
fixes#1318
(cherry picked from commit f70f60bf66)
We were somewhat *compatible* with 2.9. Though, our packages
never allowed to install Icinga Web < 2.12 together with
Icinga DB Web >= 1.2. The latter requires PHP 8.2 as a minimum
and only Icinga Web 2.12 is compatible with it. It's now time
to hard require Icinga Web 2.12, althoug you might argue that
we should have done that already with v1.2…
This PR improves the UX in the IcingaDB Web interface by:
- Enhancing the page opening behavior in column views for smoother
navigation.
- Adding a search bar to the tabs Host Services, Host History and
Service History
## Resolves
- #981
- #1288
Previously, command forms were responsible for this. But they
don't have any notion of fallback handling and are unable to
ensure proper re-submission of failed batches.
* Auth: Add method `assertColumnRestrictions`
* ObjectSuggestions: Do not suggest protected variables
`assertColumnRestrictions` does not allow to use them
anymore, hence we should not suggest them in searches
as well to not to let the user run into an error by
accepting a suggestion. Though, when fetching values
as well, we still have to obfuscate, otherwise protected
vars won't show up in details anymore.
* Introduce Icinga\Module\Icingadb\Common\Model
Must be used as base for all models, to ensure
column restrictions are asserted on filters.
* Utilize `Icinga\Module\Icingadb\Common\Model` where applicable
Since #1060, comments/delete and downtimes/delete try to use
`ObjectAuthorization`'s cache properly and override `CommandAction`'s
`isGrantedOnType()`. Though, the filter is applied to the host
and service model as a result, and not to the downtime model. This
way, downtime filters MUST be absolute, just like filters provided
by the search bar. Otherwise `name=downtime-name` will be translated
to e.g. `host.name=downtime-name` which obviously cannot match.
fixes#1245
There are multiple possible outputs for an Icinga DB version. The
package version contain the git tag, with a leading "v". The development
version mimics git-describe(1), including a commit hash separated by a
dash after the semantic version.
The current version comparison uses PHP's builtin version_compare().
This results in leading "v"s to return invalid results. Furthermore, it
treats everything behind the version as an "any string"[^0], which is
smaller than dev, alpha, beta, and so on. Thus, any git-describe(1)
version of Icinga DB 1.4.0 would be considered smaller as 1.4.0.
Fixes#1230.
[^0]: https://www.php.net/manual/en/function.version-compare.php
The old redis schema is incompatible with v1.2.0 hence the
health check should report a critical incident instead.
Also updates the health view to show a proper message.
* RedundancyGroupSummary:
- Columns are same as in DependencyNodeSummary. Column `redundancy_group.state.failed` excluded because not required here.
- Don't sort by default. Sorting the summary is not necessary and even fails for PostgreSQL as it would require adding the column to the GROUP BY clause.
- Introduce new method for(), to easily get the summary query for given group id. Adjust filter. The summary is always for parent (member).