Skip to content

fix: Missing undefined array key checks in HookableBusinessEvent (backport: 6.7.8.x)#15518

Merged
Michael Telgmann (mitelg) merged 2 commits into6.7.8.xfrom
fix/undefined-array-key-backport-6.7.8.x
Mar 12, 2026
Merged

fix: Missing undefined array key checks in HookableBusinessEvent (backport: 6.7.8.x)#15518
Michael Telgmann (mitelg) merged 2 commits into6.7.8.xfrom
fix/undefined-array-key-backport-6.7.8.x

Conversation

@shopware-octo-sts-app
Copy link
Copy Markdown
Contributor

Backport: #15420
Resolves: #15395


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

@explore-openapi
Copy link
Copy Markdown

explore-openapi bot commented Mar 12, 2026

OpenAPI Snapshot

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

📋 Additional Information

⚠️ Changes are matching an older version of the schema. Update the branch to make sure that the schema diff is correct.

⚠️ shopware/admin-api — base 6.7.8.x — 27 changes (9 removals · 18 modifications)

Diff: https://explore-openapi.dev/diff#...

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (6.7.8.x@d5fe5e0). Learn more about missing BASE report.
✅ 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             @@
##             6.7.8.x   #15518   +/-   ##
==========================================
  Coverage           ?   56.58%           
==========================================
  Files              ?     3002           
  Lines              ?    92480           
  Branches           ?        0           
==========================================
  Hits               ?    52328           
  Misses             ?    40152           
  Partials           ?        0           
Flag Coverage Δ
phpunit-migration 91.81% <ø> (?)
phpunit-unit 53.99% <30.76%> (?)

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.

@mitelg Michael Telgmann (mitelg) removed the external-contribution A PR contributed by a community member. label Mar 12, 2026
@mitelg Michael Telgmann (mitelg) force-pushed the fix/undefined-array-key-backport-6.7.8.x branch from 05d98a3 to 683bca7 Compare March 12, 2026 12:48
@mitelg Michael Telgmann (mitelg) merged commit 71a6373 into 6.7.8.x Mar 12, 2026
69 of 71 checks passed
@mitelg Michael Telgmann (mitelg) deleted the fix/undefined-array-key-backport-6.7.8.x branch March 12, 2026 15:09
@github-actions github-actions bot added this to the 6.7.8.2 milestone Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core domain/framework Responsible for the framework-level code includes core, administration, storefront, and frontends milestone/6.7.8.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants