Jetpack: Confirm Safe Mode throws 404 Not found

Created on 3 Aug 2017  路  6Comments  路  Source: Automattic/jetpack

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

General [Pri] Normal [Type] Bug

All 6 comments

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

@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.

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

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 https://github.com/Automattic/jetpack/pull/7612 in 5.3 which will solve this.

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 :)

Was this page helpful?
0 / 5 - 0 ratings