• Resolved cweblator

    (@cweblator)


    We are using Contact form 7 with a site that implements WPML for language translation. It is using the mode where it appends ?lang=xx to the query string.

    This presents an issue, as wpcf7.apiSettings.getRoute generates a url with the query string in the middle of the url, creating an invalid submission url: e.g. https://www.domain.com/wp-json?lang=xx/contact-form-7/v1/contact-forms/8663/feedback

    I have replaced the function with the following to resolve it:

    
    wpcf7.apiSettings.getRoute = function( path ) {
    		var url = wpcf7.apiSettings.root;
    
    		url = url.replace(
    			wpcf7.apiSettings.namespace,
    			wpcf7.apiSettings.namespace + path );
    
            var qs_index = url.indexOf('?');
            if(qs_index > 0)
            {
                var replace = url.substring(qs_index, (qs_index + 9));
                url = url.replace(replace, '');
            }
    
    		return url;
    	};
    

    Obviously this gets overridden whenever we have to update the plugin, so I would appreciate a permanent fix being implemented in the code.

    Kind regards
    Chris

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Incompatible with WMPL’ is closed to new replies.