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

Make Assetic integration optional #174

Merged
merged 1 commit into from
Jul 12, 2019
Merged

Make Assetic integration optional #174

merged 1 commit into from
Jul 12, 2019

Conversation

emodric
Copy link
Collaborator

@emodric emodric commented Jul 11, 2019

In cases when Assetic is not present (e.g. eZ Platform 2.5) and after updating to PHP 7.3.7 you will get an exception:

PHP Fatal error:  During class fetch: Uncaught ReflectionException: Class Assetic\Factory\Loader\FormulaLoaderInterface not found in vendor/ezsystems/legacy-bridge/mvc/Templating/LegacyFormulaLoader.php:18
Stack trace:
#0 vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php(156): require('vendor/asset...')
#1 [internal function]: Symfony\Component\Debug\DebugClassLoader->loadClass('eZ\\Publish\\Core...')
#2 [internal function]: spl_autoload_call('eZ\\Publish\\Core...')
#3 vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ClassExistenceResource.php(78): class_exists('eZ\\Publish\\Core...')
#4 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php(371): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0)
#5 vendor/symfony/symfony/src/Symfony/Component/DependencyInject in vendor/ezsystems/legacy-bridge/mvc/Templating/LegacyFormulaLoader.php on line 18

This is due to fixing https://bugs.php.net/bug.php?id=76980

This PR fixes it by making the Assetic integration optional, based on existence of Assetic\Factory\Loader\FormulaLoaderInterface interface.

@emodric emodric requested a review from andrerom July 11, 2019 12:57
@emodric emodric changed the base branch from master to 2.0 July 11, 2019 13:05
@andrerom andrerom requested a review from kmadejski July 11, 2019 14:31
@emodric
Copy link
Collaborator Author

emodric commented Jul 12, 2019

Ping @kmadejski for review, this is kinda urgent for us.

@emodric
Copy link
Collaborator Author

emodric commented Jul 12, 2019

Thank you @kmadejski !

@emodric emodric merged commit 56458fa into 2.0 Jul 12, 2019
@emodric emodric deleted the optional_assetic branch July 12, 2019 08:16
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.

3 participants