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

Tenancy Resolver being skipped #30

Open
MaximumDamage opened this issue Apr 17, 2013 · 2 comments
Open

Tenancy Resolver being skipped #30

MaximumDamage opened this issue Apr 17, 2013 · 2 comments

Comments

@MaximumDamage
Copy link

I discovered some strange behaviour.

In my system users can customize their layout obviously. For example they can add a custom logo into their system.

This works really well. I just call a service from within the layout (gsp) so that i dont have to pass tenant to model everytime.

Yet!
When my custom error page (404) is called the currentTenant results in null wich leads to terrible behaviour.

To reproduce this you would only have to use the default service load a MultiTenant object in your error gsp ( not in model ) and you will see the result of the page will always be the same. The content of your first tenant.

Is there a way to fix this. Were should I start looking?
I hope this is not a too distruptive post, I just really would like to help.
Also would be glad to research the error in master code my self.

Cheers
Max

@sronderos
Copy link
Member

I'd be happy to help if I can. Unfortunately I don't quite understand the issue. Is your custom error page using your main layout?

Since you are calling a service method from the GSP could you handle the possibility of a null tenant in the service?

What are you using to determine your tenant?

Hopefully some more info will help the team troubleshoot your issue.

@MaximumDamage
Copy link
Author

Hello,

sorry for not getting back to you.

I use a custom tenant resolver and the tenant is resolved by the request subdomain.
The error page uses the main layout, that is correct.

I could handle the case of null in my service, yet I would like to display some tenant
info on the error page, like a custom logo.

My current workaround is to redirect to error pages or let them be handled by tomcat ( uncaught / ugly 404 )
It seems that in some cases I cannot get the tenant when a 404 appears. In other cases where I handel it via redirect or i throw it the 404 works fine.

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

2 participants