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

Action is NOT appended to the page Locale URL #458

Open
hudhaifas opened this issue Aug 25, 2018 · 2 comments · May be fixed by #688
Open

Action is NOT appended to the page Locale URL #458

hudhaifas opened this issue Aug 25, 2018 · 2 comments · May be fixed by #688

Comments

@hudhaifas
Copy link

Page action is not appended to the localization link, it only shows the page link with no actions.

class MyPage extends Page {
}

class MyPageController extends PageController {
    private static $allowed_actions = ['show'];
    private static $url_handlers = ['show/$ID' => 'show'];

    public function show() {
         ....
    }
}

Template:

<select class="select" onchange="window.location.href=this.value;">
    <% loop Locales %>
        <% if LinkingMode = current %>
            <option selected value="$Link.ATT">$Title.XML</option>
        <% else %>
            <option value="$Link.ATT">$Title.XML</option>
        <% end_if %>
    <% end_loop %>
</select>

View Source: www.example.com/en/mypage/show/5

<select class="select" onchange="window.location.href=this.value;">
     <option value="www.example.com/en/mypage/" selected="">English</option>
     <option value="www.example.com/ar/mypage/">العربية</option>
</select>

show/5 Should be appended to the end of the locale link

<select class="select" onchange="window.location.href=this.value;">
     <option value="www.example.com/en/mypage/show/5" selected="">English</option>
     <option value="www.example.com/ar/mypage/show/5">العربية</option>
</select>
@robbieaverill
Copy link
Contributor

robbieaverill commented Aug 26, 2018

Yeah, this sounds like a bug to me. It sounds like one of the methods that updates the links in FluentSiteTreeExtension is not including or respecting the $action. Thanks for reporting.

@tractorcow
Copy link
Collaborator

I added some more comments to #688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants