Skip to content Skip to sidebar

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' ) );
    		}
    

2 Responses to “403 Error for Non-Admin Users in WPML”

  1. Hello,

    Why is this not fixed yet? It seems like a trivial fix in the main wpml plugin? The workaround will only work as long as the plugin will not be updated. This is ok if the plugin would fix that in a week or month but this ticket is open since May 14th 2024.

    Please fix this.

    • Hi Mark,

      This hasn’t been resolved yet, but it’s on our development roadmap. In the meantime, the workaround remains valid and should continue to work. We’ll keep the page updated with any progress.

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>