Skip Navigation

CRED uploading fails in case of specific WPML language URL format

Resolved

Reported for: Toolset Forms 1.8.3

Resolved in: Toolset CRED 1.8.4

Topic Tags: Toolset Forms

Symptoms

When WPML and CRED are activated and the WPML language URL format is set to A different domain per language, CRED uploading fails on secondary languages, throwing an error: Invalid NONCE.

Workaround

This issue will be fixed in the 1.9 release of Toolset CRED.

In the meantime, add this code to your wp-config.php file:

wp-config.php code
header('Access-Control-Allow-Origin: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    // return only the headers and not the content
    // only allow CORS if we're doing a GET - i.e. no saving for now.
    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']) &&
        $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'POST'){
        header('Access-Control-Allow-Headers: X-Requested-With');
    }
    exit;
}

and download this file, extract it and replace the class.credfile.php file in:

  • /cred-frontend-editor/embedded/toolset/toolset-common/toolset-forms/classes/ folder.
  • /types/library/toolset/toolset-common/toolset-forms/classes/ folder.
  • /views/embedded/toolset/toolset-common/toolset-forms/classes/ folder.
  • /layouts/toolset/toolset-common/toolset-forms/classes/ folder.
  • /types-access/toolset/toolset-common/toolset-forms/classes/ folder.

You have to clean the cache.

Please remember to make a backup of your files and database before doing this.

2 thought on CRED uploading fails in case of specific WPML language URL format

Comments are closed