Skip to content

Fix 500 on GET /_/contexts/<ShortName> - #583

Merged
silverbackdan merged 3 commits into
mainfrom
fix/582-contexts-500
Nov 3, 2026
Merged

silverbackdan merged 3 commits into
mainfrom
fix/582-contexts-500

Conversation

@silverbackdan

Copy link
Copy Markdown
Collaborator

Fixes #582

API Platform's ContextAction stores an array as the request's data with no resource_class, so PublishableEventListener::onPostRespond() called isConfigured(null) and the request failed with a TypeError. The listener now returns early when there is no resource class.

  • Functional: Publishable\PublishableJsonLdContextTest requests /contexts/DummyPublishableComponent and /contexts/Page anonymously and as an admin, expecting 200 (failed with the TypeError before the fix).
  • Unit: EventListener\Api\PublishableEventListenerTest covers array data with no resource class, so Infection's unit-only gate covers the changed line.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.09%. Comparing base (bdd9c79) to head (32cba02).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #583   +/-   ##
=========================================
  Coverage     97.09%   97.09%           
- Complexity     5341     5342    +1     
=========================================
  Files           438      438           
  Lines         13817    13821    +4     
=========================================
+ Hits          13415    13419    +4     
  Misses          402      402           
Flag Coverage Δ
phpunit 97.09% <100.00%> (+<0.01%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@silverbackdan
silverbackdan merged commit 7fb6f6e into main Nov 3, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 on GET /_/contexts/<ShortName>: PublishableEventListener calls isConfigured(null)

1 participant