Zeka Posted September 7, 2016 Share Posted September 7, 2016 Hi. I have some pages wich do not have translation for second language. So i uncheck checkbox for this laguage. Language switcher shows that there is no translation for english, but if i access url site.com/en/about manualy it shows page with deafault language. Is it right behavior? I think that it shoud throw 404 error instead of default language page, because there is no translation = no right content = no page for this url So the question is: does it work like this or Im missing some settings or options? Thank. Best community. 1 Link to comment Share on other sites More sharing options...
Zeka Posted September 7, 2016 Author Share Posted September 7, 2016 The question about behavior is still actual, but for to change it i use this code in init.php $currentLang = $user->language; $pageLanguages = $page->getLanguages(); if(!$pageLanguages->has($currentLang)) { throw new Wire404Exception(); } 3 1 Link to comment Share on other sites More sharing options...
cream Posted October 12, 2016 Share Posted October 12, 2016 Thanks for sharing your solution to this, Zeka! The default behaviour is not good. Link to comment Share on other sites More sharing options...
netcarver Posted October 12, 2016 Share Posted October 12, 2016 @Zeka @tkaranka If this needs fixing in the codebase, could one of you raise an issue for it in either the new ProcessWire issues repository or the requests repository. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now