-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] register template paths for overridden bundles #21077
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
Conversation
Duplicates #19586 i believe, ref #18563 The magic bundle initialization approach is under discussion i guess :) Still think #19646 was a good approach. edit: Either way the reflection magic is a code smell... and makes |
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) { | ||
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle); | ||
$reflection = new \ReflectionClass($class); | ||
$bundleInstance = $reflection->newInstanceWithoutConstructor(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wont help virtual bundles really, imo. we need to be rock solid on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with a virtual bundle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new VirtualBundle($name, $path, BundleInterface $parent)
Fixed fouserbundle for me. When this will be merged to 2.8 ? |
@Jurigag this PR has not been merged at all, but closed in favour of another one |
Previously, paths for bundles overriding a parent bundle wouldn't have been registered with the namespace of the parent bundle. I am not completely sure if this is the best solution, so I didn't invest time to write tests confirming the fix. Will do that if we agree on this approach.