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

Translatable query string conflict #12

Open
thats4shaw opened this issue Aug 29, 2017 · 1 comment
Open

Translatable query string conflict #12

thats4shaw opened this issue Aug 29, 2017 · 1 comment

Comments

@thats4shaw
Copy link

Ran into a small issue today on a site using Translatable.

Translatable adds a query string which is visible in the url attribute of a gridfield fieldset. This proves problematic as this module appends to the url attribute value and we end up with an ajax post request like
"admin/seo-editor/SiteTree/EditForm/field/SiteTree?Locale=en_NZ/update/1" which results in a bad request.

To get around it quickly i've just made an extension and included a tweaked javascript file where it deals with the creating the request url.

var url = $this.closest('.ss-gridfield').attr('data-url');
if(url.indexOf('?Locale=') != -1) {
    url = url.replace('?Locale=', '/update/' + id + '?Locale=');
} else {
    url = url + "/update/" + id;
}

Was done in a bit of rush so i'm sure there's a nicer way of dealing with this. Feel free to close if it's considered something not worth worrying about.

@brasileric
Copy link

brasileric commented Oct 18, 2017

@thats4shaw Hi. I had the same issue when using Translatable. I fixed it with your solution. Thanks for sharing!

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