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

Error pages - issues #3897

Closed
Kaik opened this issue Apr 5, 2018 · 4 comments
Closed

Error pages - issues #3897

Kaik opened this issue Apr 5, 2018 · 4 comments
Milestone

Comments

@Kaik
Copy link
Contributor

Kaik commented Apr 5, 2018

Q A
Zikula Version 2.x.x
PHP Version 7.x

I have just started playing with error pages and things are kind of wrong!
So first of all the only way, I have tried is to add custom error404 template in app/Resources... just as Symfony stated and it does work but there are issues with it.
All those are with env prod debug false and 404 error page does not exist like /loginxx
Issues

  1. no automatic assets loaded (bootstrap, jquery etc...) apart from those that are loaded in theme header
    I'm investigating this now...

  2. This is a bit more complicated issue. I have a theme with few "master" templates with no container with container-fluid and with normal container (bootstrap). This is configured in theme.yml via realms and per module/pattern and the problem is that error page is in the realm of a module/pattern that is throwing an error this is making a problem because I cannot specify error page to fit all those custom master templates.
    Best solution would be to create error realm.

  3. Well I do not know if this is not already possible but simle theme specyfic error pages I have not found a way to place error pages in theme.

@Kaik
Copy link
Contributor Author

Kaik commented Apr 5, 2018

Now I can see that issue number one is about what and where is throwing an error in my case I use /loginxxx url to throw an error and another wrong url with controller with param converter. In case of /loginxxx DefaultPageAssetSetterListener is not firing while in case of a controller 404 error it does work.

So I have found two ways of solving the first issue and

  1. just add all assets into theme header.
  2. AddJsConfigListener does work properly in both cases and it uses KernelEvents::RESPONSE instead of KernelEvents::REQUEST so I have changed DefaultPageAssetSetterListener to use KernelEvents::RESPONSE and it works

Please let me know if this is a good idea to use kernel response, in this case, someone made it this way and I do not know the reason.

@Kaik
Copy link
Contributor Author

Kaik commented Apr 5, 2018

In case of issue 2/3 I think we could create error realm for error pages so all 5xx and 4xx codes could be templated inside new error realm.

@Guite Guite added this to the 2.1.0 milestone Jul 6, 2018
@Guite Guite modified the milestones: 2.1.0, 3.0.0 Nov 2, 2018
@craigh
Copy link
Member

craigh commented Mar 21, 2020

closed by ad84476

@craigh craigh closed this as completed Mar 21, 2020
@craigh
Copy link
Member

craigh commented Mar 21, 2020

Screen Shot 2020-03-21 at 7 31 17 PM

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

No branches or pull requests

3 participants