Added
The media picker's search now matches each term on its own instead of looking for the whole input as a single substring. A file named my-image.png could not previously be found by typing "my image".
The search is split on whitespace, hyphens and underscores, and every term has to match — though any of the five searchable columns (name, title, alt, caption, description) may be the one matching it. So my-image.png is now found by "my image", "my_image", "my-image", or "image my", while my-document.png stays out of those results.
LIKE wildcards typed into the search are now escaped, so searching for 100% looks for a literal percent sign rather than matching everything. Worth knowing that _ has always been an unescaped single-character wildcard, so photo_8-sunset matched photo-8-sunset by accident while a hyphen did nothing; that inconsistency is gone.
Case sensitivity is still left to the database — Postgres LIKE is case-sensitive where MySQL and SQLite are not. That is unchanged from previous versions.
Thanks to @amywestlake for reporting this and proposing the original approach in #623.
Fixed
Search results are now ordered by the panel's sort direction, matching the unfiltered list. There was no ORDER BY at all before, so the 50-row limit truncated an arbitrary slice of matches.
GliderFallback's setters were typed to require a value, while every property except the name is optional and every getter already returned null. Building a fallback from a conditional expression — the usual reason to have one — threw a TypeError in a service provider before the application could boot:
GliderFallback::make('logo')
->alt(config('app.name'))
->source(filled(setting('logo')) ? $logo->url : Vite::image('logo.webp'))alt(), height(), source(), type() and width() now all accept null.
A registered fallback that ends up with no source still cannot be rendered, but it now names itself — The [logo] glider fallback does not have a source. — instead of reporting the media item as invalid, which pointed at the wrong thing.
Thanks again to @battulga0719 for reporting this in #718.
Upgrading
No changes are required for ordinary use. Two notes:
- If you extended
GliderFallbackand overrode any of the setters with the narrowerstring/intsignature, widen it to?string/?intto match the parent. - Typing
0into the picker search previously reset the list to show everything. It now searches for "0"; whitespace-only input is what falls back to the unfiltered list.