Skip to content

Correct the EntitySearchInputType option defaults - #2186

Merged
kpodemski merged 1 commit into
PrestaShop:9.xfrom
boo-code:fix/entity-search-input-type-options
Dec 2, 2026
Merged

kpodemski merged 1 commit into
PrestaShop:9.xfrom
boo-code:fix/entity-search-input-type-options

Conversation

@boo-code

@boo-code boo-code commented Dec 2, 2026

Copy link
Copy Markdown
Contributor
Questions Answers
Branch? 9.x
Description? The option table of EntitySearchInputType disagrees with the form type on 9.0.0, 9.1.0 and 9.2.x: min_length defaults to 2 (not 3) and limit to 0, which means no limit (not 1, and it caps the selected entities rather than the items displayed). remote_url defaults to null and is the endpoint itself: there is no default endpoint to override, and __QUERY__ in it is replaced by the search phrase. The note under the required JavaScript components now says that EntitySearchInput is built with the field container, so window.prestashop.component.initComponents() cannot load it - doing so fails with Cannot read properties of undefined (reading 'data'), as reported in PrestaShop/PrestaShop#34667.
Fixed ticket?
Sponsor company

Sources, all on 9.2.x: the defaults in src/PrestaShopBundle/Form/Admin/Type/EntitySearchInputType.php (configureOptions()), the limit check dataLimit !== 0 && $entityItems.length >= dataLimit and the queryWildcard default __QUERY__ in admin-dev/themes/new-theme/js/components/entity-search-input.ts, and initComponents() in admin-dev/themes/new-theme/js/app/utils/init-components.ts, which constructs each component with no argument.

min_length defaults to 2 and limit to 0 (no limit) in EntitySearchInputType on 9.0.0, 9.1.0
and 9.2.x; remote_url has no default endpoint, it is the URL the search calls with
__QUERY__ replaced. The note under the required components now says that
EntitySearchInput needs the field container and so cannot be loaded with
initComponents(), which fails with "Cannot read properties of undefined".
@github-actions github-actions Bot added the 9.x label Dec 2, 2026
@kpodemski
kpodemski merged commit 5f76966 into PrestaShop:9.x Dec 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants