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

Fix BC break on escaper extension #4083

Merged
merged 1 commit into from May 11, 2024
Merged

Fix BC break on escaper extension #4083

merged 1 commit into from May 11, 2024

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented May 11, 2024

Closes #4082

@tacman Can you test that this fixes your issue?

@fabpot fabpot force-pushed the escaper-fix branch 3 times, most recently from 529b344 to 740aee1 Compare May 11, 2024 14:40
@tacman
Copy link

tacman commented May 11, 2024

I hate to ask such a simple question, but how do I install this branch as 3.8 (since other bundles require twig/twig:^3.8?

composer req twig/twig:dev-escaper-fix
./composer.json has been updated
Running composer update twig/twig
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires twig/twig dev-escaper-fix, found twig/twig[dev-ci-fix, 1.3.0, ..., 1.x-dev, v2.0.0, ..., 2.x-dev, v3.0.0-BETA1, ..., 3.x-dev, 4.x-dev] but it does not match the constraint.
  Problem 2
    - survos/api-grid-bundle is locked to version 1.5.224 and an update of this package was not requested.
    - survos/api-grid-bundle 1.5.224 requires twig/twig ^3.8 -> found twig/twig[v3.8.0, ..., 3.x-dev] but it conflicts with your root composer.json require (dev-escaper-fix).
  Problem 3

@fabpot
Copy link
Contributor Author

fabpot commented May 11, 2024

@nicklog
Copy link

nicklog commented May 11, 2024

Hey @fabpot

i checked out the branch and for me the fix does not resolve the problem.

You must call "setEscaperRuntime()" before calling "Twig\Extension\EscaperExtension::addSafeClass()".
LogicException:
You must call "setEscaperRuntime()" before calling "Twig\Extension\EscaperExtension::addSafeClass()".

  at vendor/twig/twig/src/Extension/EscaperExtension.php:180
  at Twig\Extension\EscaperExtension->addSafeClass('Symfony\\UX\\TwigComponent\\ComponentAttributes', array('html'))
     (vendor/symfony/ux-twig-component/src/Twig/TwigEnvironmentConfigurator.php:35)
  at Symfony\UX\TwigComponent\Twig\TwigEnvironmentConfigurator->configure(object(Environment))
     (var/cache/dev/ContainerFCKoKDv/App_KernelDevDebugContainer.php:2123)
  at ContainerFCKoKDv\App_KernelDevDebugContainer::getTwigService(object(App_KernelDevDebugContainer))
     (var/cache/dev/ContainerFCKoKDv/App_KernelDevDebugContainer.php:578)
  at ContainerFCKoKDv\App_KernelDevDebugContainer::get_Container_Private_ProfilerService(object(App_KernelDevDebugContainer))
     (var/cache/dev/ContainerFCKoKDv/App_KernelDevDebugContainer.php:1785)
  at ContainerFCKoKDv\App_KernelDevDebugContainer::getProfilerListenerService(object(App_KernelDevDebugContainer))
     (var/cache/dev/ContainerFCKoKDv/App_KernelDevDebugContainer.php:907)
  at ContainerFCKoKDv\App_KernelDevDebugContainer::ContainerFCKoKDv\{closure}()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:221)
  at Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('kernel.response')
     (vendor/symfony/event-dispatcher/EventDispatcher.php:70)
  at Symfony\Component\EventDispatcher\EventDispatcher->getListeners('kernel.response')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:257)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess('kernel.response')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:121)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ResponseEvent), 'kernel.response')
     (vendor/symfony/http-kernel/HttpKernel.php:211)
  at Symfony\Component\HttpKernel\HttpKernel->filterResponse(object(RedirectResponse), object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:199)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:185)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/var/www/html/vendor/autoload_runtime.php')
     (public/index.php:5)       

@fabpot
Copy link
Contributor Author

fabpot commented May 11, 2024

@nicklog Can you test with the new version of the patch?

@nicklog
Copy link

nicklog commented May 11, 2024

@fabpot it works 👍🏼

@fabpot fabpot merged commit 1de5736 into twigphp:3.x May 11, 2024
73 of 76 checks passed
@fabpot fabpot deleted the escaper-fix branch May 11, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

call setEscaperRuntime() before calling Twig\Extension\EscaperExtension::addSafeClass().
3 participants