Skip to content

Model: Accept passed properties in the constructor#161

Merged
nilmerg merged 1 commit into
mainfrom
fix/very-old-oversight
May 21, 2026
Merged

Model: Accept passed properties in the constructor#161
nilmerg merged 1 commit into
mainfrom
fix/very-old-oversight

Conversation

@nilmerg
Copy link
Copy Markdown
Member

@nilmerg nilmerg commented May 21, 2026

This fixes a long standing oversight which wasn't even noticed when fixing access to a private property as it accessed $this->properties initially. This must have been a typo and the intendend check was to avoid passing an empty array and null to setProperties, as the constructor was always final and it is impossible the property can be non-empty at this stage. And even if so, why on earth would a base implementation only accept custom properties if it already has some…

This fixes a long standing oversight which wasn't even
noticed when fixing access to a private property as it
accessed `$this->properties` initially. This must have
been a typo and the intendend check was to avoid passing
an empty array and null to `setProperties`, as the
constructor was always final and it is impossible the
property can be non-empty at this stage. And even if so,
why on earth would a base implementation only accept
custom properties if it already has some…
Copy link
Copy Markdown
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And even if so, why on earth would a base implementation only accept custom properties if it already has some…

Idk 🤷!

@nilmerg nilmerg merged commit fcb4f05 into main May 21, 2026
13 checks passed
@nilmerg nilmerg deleted the fix/very-old-oversight branch May 21, 2026 10:00
@github-project-automation github-project-automation Bot moved this from In progress to Done in Icinga Notifications 1.0 May 21, 2026
nilmerg added a commit to Icinga/icingadb-web that referenced this pull request May 22, 2026
This PR adds a new `V2/Icinga2Source` hook implementation to integrate
with the `V2/SourceHook` interface from `icinga-notifications-web`.

### Supporting changes required by the hook:
- Introduce `QueryValuesProvider` — Decouples value suggestion logic
from `ObjectSuggestions` into a standalone Generator-based class. This
allows the hook's `getValueSuggestions()` to reuse the same suggestion
infrastructure without a `Suggestions` context.
- `QueryColumnsProvider`: Add `setShowRelationLabels()` setter — Exposes
the relation label display option so the hook can control it.
- `QueryColumnsProvider`: Make `collectFilterColumns()` protected — No
longer needs to be public; the override in `SearchControls` that called
it statically is removed as the optimization it provided is no longer
necessary.
- `ObjectSuggestions`: Remove label-to-path resolution for columns with
spaces to ensure consistency between the suggestions in the search bar
and suggestions provided by the `Icinga2Source`.

resolves: #1365
### Requires:
- Icinga/icinga-notifications-web#469
- #1375
- Icinga/ipl-orm#161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants