Skip to content

Fix SearchControls trait#1388

Merged
nilmerg merged 2 commits into
mainfrom
fix/search-controls
Jun 25, 2026
Merged

Fix SearchControls trait#1388
nilmerg merged 2 commits into
mainfrom
fix/search-controls

Conversation

@BastianLedererIcinga

Copy link
Copy Markdown
Contributor

#1046 introduced two problems to the SearchControls trait.

Returning false from SearchControls::callHandleRequest() prevents the ipl-web SearchControls trait from calling handleRequest() in both createSearchBar() and createSearchEditor().
An implementation of createSearchEditor() is added, which explicitly calls $editor->handleRequest() as createSearchBar() already does. Without this no SearchEditor in the entire module is usable.

An other problem is that moving the call of $searchbar->handleRequest() also delayed its assemble(), so this if block was entered before the assemble, resulting in the wrapper being added twice.

if (($wrapper = $searchBar->getWrapper()) && ! $wrapper->getWrapper()) {
    // TODO: Remove this once ipl-web v0.7.0 is required
    $searchBar->addWrapper(Html::tag('div', ['class' => 'search-controls']));
}

which caused a visual bug:

Screenshot from 2026-06-25 11-01-42

The statement should be safe to remove together with the less that has the same TODO.

`callHandleRequest()` returning false prevents the ipl-web
trait from calling `handleRequest` for both the created `SearchBar`
and `SearchEditor`.
`createSearchBar()` already calls it explicitly, the same must be done
in `createSearchEditor()`, to create a functional `SearchEditor`.
17e8498 moved the call of `$searchBar->handleRequest()` and
the subsequent call of `assemble()` after an if satement, which
served the purpose of adding a missing `.search-controls` wrapper
for ipl-web < 0.7.0.

Since `SearchBar::assemble` is responsible for adding this wrapper,
it was added twice causing a visual bug.
@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Jun 25, 2026

@nilmerg nilmerg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. :)

@nilmerg
nilmerg merged commit b7da98f into main Jun 25, 2026
13 checks passed
@nilmerg
nilmerg deleted the fix/search-controls branch June 25, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants