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

Confirm Safe Mode throws 404 Not found #7589

Closed
mikaelz opened this issue Aug 3, 2017 · 6 comments · Fixed by #7612
Closed

Confirm Safe Mode throws 404 Not found #7589

mikaelz opened this issue Aug 3, 2017 · 6 comments · Fixed by #7612
Assignees
Labels
General [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@mikaelz
Copy link
Contributor

mikaelz commented Aug 3, 2017

Clean WordPress 4.8.1 install with Akismet 3.3.4, Jetpack 5.2.1, qTranslate-X 3.4.6.8

Disabled Little Snitch (firewall) still persists.

screen shot 2017-08-03 at 11 27 34
screen shot 2017-08-03 at 11 19 00

@mikaelz
Copy link
Contributor Author

mikaelz commented Aug 6, 2017

Deactivating qTranslate-X fixed the issue. Plugin rewrote the URL. How could we prevent it? API URL should not be translated

@kraftbj
Copy link
Contributor

kraftbj commented Aug 6, 2017

@ebinnion I'm tagging you since you are neck deep with language plugins.

@mikaelz My first thought is this may be a bug with the other plugin since we just ask Core for the REST API URL.

@kraftbj kraftbj added General [Type] Bug When a feature is broken and / or not performing as intended [Pri] Normal labels Aug 6, 2017
@mikaelz
Copy link
Contributor Author

mikaelz commented Aug 6, 2017

What I don't understand now is what/when is changing the REST API URL idcL10n.apiRoot

screen shot 2017-08-06 at 13 52 33

At https://github.com/Automattic/jetpack/blob/5.2.1/_inc/idc-notice.js#L99 the URL is good.
AJAX response triggers error https://github.com/Automattic/jetpack/blob/5.2.1/_inc/idc-notice.js#L117

@mikaelz
Copy link
Contributor Author

mikaelz commented Aug 6, 2017

@eliorivero
Copy link
Contributor

eliorivero commented Aug 8, 2017

Hi @mikaelz thanks for opening this issue. You can solve this on your installation now with this filter:

<?php
function jetpack_no_qtranslate_rest_url_redirect( $url_lang, $url_orig, $url_info ) {
	if ( false !== strpos( $url_info['wp-path'], 'wp-json/jetpack' ) ) {
		return false;
	}
	return $url_lang;
}
add_filter( 'qtranslate_language_detect_redirect', 'jetpack_no_qtranslate_rest_url_redirect', 10, 3 );

It will check if the url is a REST one, and if so, returning false will prevent the redirection.

We'll introduce #7612 in 5.3 which will solve this.

@mikaelz
Copy link
Contributor Author

mikaelz commented Aug 9, 2017

Thanks @eliorivero. Checked the solution in the mentioned PR and I like it. Didn't know why the 3rd-party dir exists. Learned something new today :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants