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

Webspace Validation shows "Unable to find template ..." #30

Open
brachycera opened this issue Jul 15, 2022 · 3 comments
Open

Webspace Validation shows "Unable to find template ..." #30

brachycera opened this issue Jul 15, 2022 · 3 comments
Labels

Comments

@brachycera
Copy link

Q A
Bug? Yes?!
New Feature? no
Bundle Version 3.0
Sulu Version 2.4.3.
Browser Version Browser name and version

Actual Behavior

Create a Theme with the folder structure

-- config
--- templates
---- pages
----- foo.xml

-- templates
--- pages
---- foo.twig.html

-- themes
--- foo_theme
--- theme.json
---- pages
------ foo.twig.html

Expected Behavior

The Webspace validation shows no errors:

php bin/adminconsole sulu:content:validate:webspaces

The SylusTheme list command shows the correct theme "foo_theme":

php bin/adminconsole sylius:theme:list

Steps to Reproduce

Now remove the foo template from templates/pages/foo.twig.html

The Website works without errors and uses the expected template file themes/foo_theme/pages/foo.twig.html.

But the Webspace validation now shows an error:

Page Templates:
    page: foo -> failed: Unable to find templates "pages/foo.html.twig".

Is this the expected behavior and must I keep both templates templates/pages/foo.twig.html and themes/foo_theme/pages/foo.twig.html in place even when I use the SuluTheme package?

@alexander-schranz
Copy link
Member

alexander-schranz commented Jul 15, 2022

@brachycera Thx for creating the issue. The sulu:content:validate:webspaces only knows about the default templates and know nothing about the sylius themes.

The problem here is the sulu:content command lives in the sulu/sulu package and should not know about themes and so fails in this case.

We would then need a requirement of themes in sulu core which we currently wanted to avoid. There was already a PR for it sulu/sulu#5806, which did not get merged because of dependency issue.

The only solution I see would be we add a interface for checking the existing of templates in the sulu core, the core behave like currently. And in SuluThemeBundle we override that service to keep the themes in mind.

@brachycera
Copy link
Author

Hey @alexander-schranz,
many thanks for you answer! I was already suspecting that sulu/sulu had no knowledge that the SuluThemePackage is installed. My concern was - that I have to keep the template files in sync in two places themes/foo_theme/... and templates/.... But since the error is a false negative I guess I don't have to do that 😉

@alexander-schranz
Copy link
Member

Yeah the error is a false negative. I will still keep the issue open so we maybe can tackle it one day.

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