Skip to content

fix: Missing undefined array key checks in HookableBusinessEvent#15420

Merged
Michael Telgmann (mitelg) merged 2 commits intotrunkfrom
fix/undefined-array-key
Mar 10, 2026
Merged

fix: Missing undefined array key checks in HookableBusinessEvent#15420
Michael Telgmann (mitelg) merged 2 commits intotrunkfrom
fix/undefined-array-key

Conversation

@mitelg
Copy link
Copy Markdown
Member

1. Why is this change necessary?

Due to the refactoring of removing the usage of empty it can now happen, that an undefined array key access is happening in the HookableBusinessEvent. (see PR https://github.com/shopware/shopware/pull/15042/changes#diff-805d7e1aa3994187a04e7a6b72cc75ab40ef9f46e90d344909a5e961f269728dR64-R65 )

2. What does this change do, exactly?

Use ?? operator to initialise the variables correctly.

3. Describe each step to reproduce the issue or behaviour.

Execute the HookableBusinessEventTest with the restrictWarnings setting in the phpunit.xml.dist set to false. Warnings about undefined array key will appear, like described in the linked issue.

4. Please link to the relevant issues (if any).

5. Checklist

  • I have written tests and verified that they fail without my change
  • I have updated developer-facing release notes if this change is relevant for external developers:
    • Add a short entry to RELEASE_INFO-6.<major>.md under “Upcoming” for informational changes, including the consequences of the change and how it affects external developers.
    • Add an UPGRADE section in UPGRADE-6.<next-major>.md for breaking changes (what/why/impact/how to adapt).
    • See the Documenting a Release Process for details.
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfilled them

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

Warnings
⚠️ The Pull Request doesn't contain any release info, if your changes are relevant for external developers please add an entry to the release info file, including the consequences of the change and how it affects external developers. For detailed infos please refer to the [release documentation guide](https://github.com/shopware/shopware/blob/trunk/delivery-process/documenting-a-release.md).

@explore-openapi
Copy link
Copy Markdown

explore-openapi bot commented Mar 9, 2026

OpenAPI Snapshot

ℹ️ shopware/store-api — schema identical to base trunk

ℹ️ shopware/admin-api — schema identical to base trunk

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.14%. Comparing base (e805c03) to head (60d4e04).
⚠️ Report is 24 commits behind head on trunk.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rc/Core/Framework/Event/BusinessEventCollector.php 0.00% 8 Missing ⚠️
src/Core/Framework/Event/BusinessEventRegistry.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #15420      +/-   ##
==========================================
- Coverage   57.15%   57.14%   -0.01%     
==========================================
  Files        3011     3011              
  Lines       94076    94085       +9     
==========================================
+ Hits        53765    53766       +1     
- Misses      40311    40319       +8     
Flag Coverage Δ
phpunit-migration 92.35% <ø> (ø)
phpunit-unit 54.26% <30.76%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shyim Soner (shyim) removed their request for review March 10, 2026 04:14
@mitelg Michael Telgmann (mitelg) added this pull request to the merge queue Mar 10, 2026
Merged via the queue into trunk with commit 5cbf2e6 Mar 10, 2026
67 of 68 checks passed
@mitelg Michael Telgmann (mitelg) deleted the fix/undefined-array-key branch March 10, 2026 09:16
@github-actions github-actions bot added this to the 6.7.9.0 milestone Mar 10, 2026
@mitelg Michael Telgmann (mitelg) added the backport-6.7.8.x Backport changes into 6.7.8.x label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-6.7.8.x Backport changes into 6.7.8.x component/core domain/framework Responsible for the framework-level code includes core, administration, storefront, and frontends milestone/6.7.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order state change throws error if you have installed app that activates webhooks for order status change

4 participants