fix(registry): use LIKE_OPERATOR in the plugin search and category tree

Merged
CE
7d ago
+106-16

Problem

The plugin registry search (SearchPluginsQueryHandler) and category tree (PluginCategoryService.getTree) hard-code ILIKE for the search, description, author, license and category-name filters, in both the TypeORM and Knex arms. ILIKE exists on PostgreSQL only, so these filters fail with a SQL syntax error on MySQL and SQLite.

Fix

Use core's LIKE_OPERATOR (ILIKE on PostgreSQL, LIKE elsewhere), as other plugins do: interpolated into the TypeORM conditions and passed as the Knex operator.

Tests

New search-plugins-query.handler.spec.ts: with LIKE_OPERATOR resolved to LIKE, the TypeORM conditions and Knex operators for search, description, author and license all use LIKE.

Notes

Not built or run locally.


Summary by cubic

Fixes plugin registry search and category tree filters using hard-coded ILIKE, which fails on MySQL and SQLite, by using core's LIKE_OPERATOR (ILIKE on PostgreSQL, LIKE elsewhere).

  • Replaces ILIKE with LIKE_OPERATOR in TypeORM conditions and Knex operators for search, description, author, license, and category-name filters in SearchPluginsQueryHandler and PluginCategoryService.getTree.
  • Adds search-plugins-query.handler.spec.ts verifying LIKE_OPERATOR is used in both query-builder arms.