Repository navigation
fix: read search results through getEntities() for Shopware 6.8 - #308
Conversation
EntitySearchResult::first() is deprecated for v6.8.0.0, and with the V6_8_0_0 flag active core throws instead of warning. A signed-in buyer's get_order went through it in ShopwareOrderGateway::loadOrder(), so the call answered `internal: The tool call failed unexpectedly.` on a 6.8 lane while it passed on 6.7. Found by the shopware-mcp-evals next-major lane. The six other calls of the same method, in SalesChannelViewProvider, the /ucp/mcp proxy, the fallback agentic file renderer and both product export providers, move to getEntities()->first() as well. getEntities() exists from 6.5 on. The customer order read test now also runs with the v6.8.0.0 deprecations enforced.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Dominik Grothaus (dgrothaus-sw)
left a comment
There was a problem hiding this comment.
The description says PHPStan's deprecation findings for EntitySearchResult drop to none. That holds on a lane whose root loads core's PHPStan rules. CI never reported them. php-quality (trunk) on the base and future-compatibility on the base ended with no errors as well. Those jobs install the Shopware checkout with --no-dev, so bin/run.php injects no core rules there.
After the merge, ShopwareOrderGatewayTest is the only test that checks the next-major behaviour. The six other sites can regress unnoticed.
I suggest a follow-up that loads phpstan/phpstan-deprecation-rules in the future-compatibility job, so the next deprecated DAL call fails there instead of on a 6.8 lane.
| ))); | ||
| } | ||
|
|
||
| public static function majorFeatureFlagProvider(): \Generator |
There was a problem hiding this comment.
On the 6.6 lane PHPStan reports this provider with missingType.generics, because \Generator carries no type arguments. Every other provider in tests/Unit returns iterable with a @return iterable<string, array{…}> docblock, for example UcpCheckoutCompletionPreviewTest::blockedStatusProvider().
Please match that shape:
/**
* @return iterable<string, array{list<string>}>
*/
public static function majorFeatureFlagProvider(): iterable
EntitySearchResult::first()is deprecated forv6.8.0.0, and with theV6_8_0_0flag active core throws instead of warning. A signed-in buyer'sget_ordercalls it while loading the order, so on a 6.8 lane the tool answeredinternal: The tool call failed unexpectedly.while the same read passes on 6.7. The shopware-mcp-evals next-major lane found it (shopware/shopware-mcp-evals#99), and it reproduces on a trunk lane with the flag set.The order gateway now reads
getEntities()->first(), and so do the six other calls of the same method: the sales channel view provider, the/ucp/mcpproxy, the fallback agentic file renderer and both product export providers. PHPStan's deprecation findings forEntitySearchResultdrop to none.getEntities()exists from 6.5 on.The customer order read test now runs twice, once as before and once with the
v6.8.0.0deprecations enforced throughFeature::fake().No changelog entry: the plugin supports up to 6.7, where the old call still works, so no shop notices the change.
# next versionin both changelogs.