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

Symfony 4.1 compatibility #193

Merged
merged 5 commits into from
Oct 4, 2018
Merged

Symfony 4.1 compatibility #193

merged 5 commits into from
Oct 4, 2018

Conversation

emulienfou
Copy link
Contributor

Hi there,
on Symfony 4.1 there is some errors with this bundle:

  1. Replace method getDefinition by findDefinition to fix error: You have requested a non-existent service "twig.loader.filesystem"
  2. Declare service locally templating.filename_parser to fix error: You have requested a non-existent service "templating.filename_parser".
  3. Set missing arguments for class \Liip\ThemeBundle\Twig\Loader\FilesystemLoader

@emulienfou
Copy link
Contributor Author

Related issue: #188

@lsmith77
Copy link
Contributor

lsmith77 commented Oct 4, 2018

thx .. can you look into the test failure?

@lsmith77
Copy link
Contributor

lsmith77 commented Oct 4, 2018

hurray!

@lsmith77 lsmith77 merged commit ff3d7fa into liip:master Oct 4, 2018
@lsmith77
Copy link
Contributor

lsmith77 commented Oct 4, 2018

$twigFilesystemLoaderDefinition->setClass($container->getParameter('liip_theme.filesystem_loader.class'));
$twigFilesystemLoaderDefinition->setArguments(array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not totally sure, but is it possible that this call makes the bundle fail on Symfony 2.8.46? I receive an error like this:

Unable to find template "SuluWebsiteBundle:Analytics:website.html.twig|default".

But when i comment this call out, everything works again... Can somebody confirm? Should there be a check for the symfony version? Or does LiipThemeBundle starting from version 1.6 not support symfony 2 anymore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well we still support Symfony 2 if it doesn't cause major problems ..
I was expecting the test suite to catch any such issues, but maybe it does not ..

So if you can come up with a simple enough fix to make it work again I am happy to merge it.

$twigFilesystemLoaderDefinition->setClass($container->getParameter('liip_theme.filesystem_loader.class'));
$twigFilesystemLoaderDefinition->setArguments(array(
$container->getDefinition('liip_theme.templating_locator'),
$container->getDefinition('templating.filename_parser')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That line seems to be the root cause of the issue :-) It generally works with Symfony 2.8 (that's probably why the test didn't fail), but the colon notation (Bundle:folder:view.html.twig) does not work anymore... Does anything speak against using the TemplateNameParser here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably continue the discussion in #194.

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.

3 participants