| Q | A
|-----------------|-----
| Branch? | 2.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Fixed tickets | fixes#17953
| License | MIT
## Summary
Removes explicit `choice_value => 'code'` from autocomplete form types
to fix a **critical performance issue**.
### The Problem
When `choice_value` is explicitly set (even to a property like `code`),
Symfony's `DoctrineChoiceLoader` cannot use the optimized
`getEntitiesByIds()` query. Instead, it falls back to loading **ALL
entities** via `getEntities()` without any WHERE clause.
With 4000+ products, this causes severe performance degradation.
### The Solution
- Remove `choice_value` option, letting Symfony use the default (entity
ID)
- This enables the optimized `WHERE id IN (...)` query
- Update all Behat contexts/elements to use `getId()` instead of
`getCode()`
### References
- [Symfony UX Issue #2736](https://github.com/symfony/ux/issues/2736) -
Extra query without WHERE when choice_value is defined
- [Symfony Issue
#57724](https://github.com/symfony/symfony/issues/57724) - EntityType
performance with large datasets
- [Lazy Choice Loader (Symfony
7.2)](https://symfony.com/blog/new-in-symfony-7-2-lazy-choice-loader)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Improvements**
* Autocomplete fields across products, variants, options and taxons now
display and select by human-readable names while using stable internal
identifiers for form submissions.
* Catalog promotion scope controls updated for clearer name-based
selection and feedback when adding/removing scopes.
* Product image and variant selection flows enhanced to show and verify
selected variant names more reliably.
* Taxon parent selection improved for richer behavior in
JavaScript-enabled admin pages.
* **Documentation**
* Added upgrade notes explaining autocomplete behavior and migration
considerations.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
StatisticsComponent was using native DateTime for calculating date ranges,
ignoring the mocked clock in Behat tests. This caused flaky tests depending
on the actual system date.
- Add ClockInterface dependency to StatisticsComponent
- Update OrderContext to set checkoutCompletedAt with mocked clock
- Add deprecation notice for missing clock argument