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

Search Block overrides require refactoring #2872

Closed
craigh opened this issue Apr 28, 2016 · 11 comments
Closed

Search Block overrides require refactoring #2872

craigh opened this issue Apr 28, 2016 · 11 comments
Assignees
Labels
Milestone

Comments

@craigh
Copy link
Member

craigh commented Apr 28, 2016

Q A
Zikula Version 1.4.3-dev

Expected behavior

same appearance as 1.4.2

Actual behavior

block appears as 'stock' appearance - no overrides in effect

Steps to reproduce

install.

@Guite - because of your recent refactoring to twig, the old smarty overrides need to be fixed.

@Guite
Copy link
Member

Guite commented Apr 29, 2016

@craigh I've migrated the templates in #2873.
They are not recognised though.
This seems to be caused by the TemplatePathOverrideListener which is not called for AbstractBlockHandler instances. Maybe KernelEvents::CONTROLLER is not adequate for these at all.

@craigh
Copy link
Member Author

craigh commented Apr 29, 2016

I think your directory structure is wrong. Try eliminating the /views level so it is just like src/themes/Andreas08Theme/Resources/ZikulaSearchModule/Block/search.html.twig

@craigh
Copy link
Member Author

craigh commented Apr 29, 2016

hmmm. I'm still not sure about this. see https://github.com/zikula/SpecTheme/blob/master/Resources/README.md includes the /views

if you can't get it to work, merge it anyway and I will have to take a look later on. Keep this ticket open.

@Guite
Copy link
Member

Guite commented Apr 29, 2016

I added an echo statement to the TemplatePathOverrideListener and still think that it is not called at all for blocks.

@Guite Guite assigned craigh and unassigned Guite Apr 29, 2016
@craigh
Copy link
Member Author

craigh commented Apr 29, 2016

I believe TemplatePathOverrideListener is legacy only

@Guite
Copy link
Member

Guite commented Apr 29, 2016

How/where is the override then recognised?

@Guite
Copy link
Member

Guite commented Apr 29, 2016

https://github.com/zikula/SpecTheme/blob/master/README.md states that the ZikulaKernel applies only for ZikulaFooBundle:Bar:index.html.twig type notation. The search block uses the other one, see here: https://github.com/zikula/core/blob/1.4/src/system/SearchModule/Block/SearchBlock.php#L56

@Guite
Copy link
Member

Guite commented Apr 29, 2016

Comments in the ZikulaKernel method you've pointed to say the same.

@craigh
Copy link
Member Author

craigh commented Apr 29, 2016

ok (doing this from work with no code in front of me...) can you make sure TemplatePathOverrideListener is firing?

@craigh craigh added the Bug label Aug 14, 2016
@craigh
Copy link
Member Author

craigh commented Aug 14, 2016

changing

return $this->renderView('@ZikulaSearchModule/Block/search.html.twig', $templateParameters);

to

return $this->renderView('ZikulaSearchModule:Block:search.html.twig', $templateParameters);

fixes this problem. so there is definitely something wrong with the namespaced method. I'm still looking into it.

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

2 participants