Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Symfony Profiler when api-platform/core not installed #6709

Closed
ZZromanZZ opened this issue Oct 9, 2024 · 4 comments
Closed

Broken Symfony Profiler when api-platform/core not installed #6709

ZZromanZZ opened this issue Oct 9, 2024 · 4 comments
Labels

Comments

@ZZromanZZ
Copy link

ZZromanZZ commented Oct 9, 2024

API Platform version(s) affected: 4.0 (maybe even older)

Description

Error is occuring on loading Symfony Web Profiler
Toolbar is shown with message An error occurred while loading the web debug toolbar.

How to reproduce

Install via Composer only with api-platform/symfony (not api-platform/core)

Possible Solution

ApiPlatform\Symfony\Bundle\DataCollector\RequestDataCollector::getVersion references api/platform/core to get its version, when changed to get version from api-platform/symfony, it works as expected

Additional Context

[2024-10-09T13:10:34.633853+02:00] request.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Package "api-platform/core" is not installed")." at request.html.twig line 86 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Package \"api-platform/core\" is not installed\"). at /srv/app/v2/vendor/api-platform/symfony/Bundle/Resources/views/DataCollector/request.html.twig:86)\n[previous exception] [object] (OutOfBoundsException(code: 0): Package \"api-platform/core\" is not installed at /srv/app/v2/vendor/composer/InstalledVersions.php:203)"} []
@DavidFeller
Copy link

I'm facing the same issue.

@soyuka
Copy link
Member

soyuka commented Oct 14, 2024

Oh nice catch, thanks! Could you review my patch?

@ZZromanZZ
Copy link
Author

@soyuka Works for me, thanks.

@ZZromanZZ
Copy link
Author

@soyuka But agree with @dunglas, we are at Symfony environment so we should assume that api-platform/symfony is installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants