Skip Navigation

Open

Reported for: WPML Multilingual CMS 4.5.9

Topic Tags: Bug

Overview of the issue

Non-admin users, such as editors or custom roles, experience a 403 Forbidden error in the browser console when accessing certain WPML functionality related to the Advanced Translation Editor (ATE) jobs synchronization. This error is evident when inspecting the console tab in browser developer tools.

Keep in mind that this issue won’t affect your site or its translations, you can continue using WPML and translating your website.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Loader.php file.
  • Replace:
    			Hooks::onAction( 'wp_loaded' )
    			     ->then( [ self::class, 'getData' ] )
    			     ->then( $maybeLoadStatusBarAndATEConsole )
    			     ->then( Resources::enqueueApp( 'ate-jobs-sync' ) )
    			     ->then( Fns::always( make( WPML_TM_Scripts_Factory::class ) ) )
    			     ->then( invoke( 'localize_script' )->with( 'wpml-ate-jobs-sync-ui' ) );
    
  • With:
    		if (current_user_can('translate') || current_user_can('manage_options') || current_user_can('manage_translations')) {
    			Hooks::onAction( 'wp_loaded' )
    			     ->then( [ self::class, 'getData' ] )
    			     ->then( $maybeLoadStatusBarAndATEConsole )
    			     ->then( Resources::enqueueApp( 'ate-jobs-sync' ) )
    			     ->then( Fns::always( make( WPML_TM_Scripts_Factory::class ) ) )
    			     ->then( invoke( 'localize_script' )->with( 'wpml-ate-jobs-sync-ui' ) );
    		}
    

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>