Martimiz/silverstripe-languageprefix

cannot call action on homepage

Closed this issue · 1 comments

i made an action on my page_controller called "logout".

calling an url like "/logout/" or "/de/logout" results in a 404 beause PrefixModelAsController

a) handles all urls without prefix as 404 (maybe no bug but a feature)
b) doesn't check for actions on homepage.

"/de/home/logout/" works like a charm ;)

a) handles all urls without prefix as 404 (maybe no bug but a feature)

I tended to think of it as a feature :) I'm not happy allowing links that have no prefix - because without a redirect the only way to tell the current locale is by sending the ?locale= querystring, and the whole point was to replace this with the prefix. Maybe use another way to localize hardcoded links? something like {$Prefix}/logout?

b) doesn't check for actions on homepage.

It would seem that way... Have to check how ModelAsController handles this, I remember there used to be an issue there, but could be wrong...

[EDIT] Just checked, but the default ModelAsController acts the same: obviously you need to use /home/action...