Open
Reported for: WPML Multilingual CMS 4.5.9
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' ) ); }
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.