Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client's content managers, responsible for translations, lost access to posts and pages after an update, receiving a message stating they do not have the rights to translate from NL to ES.
Solution:
We recommend updating to the latest version of WPML, as this issue should be resolved in version 4.6.9. Before updating, ensure to have a complete backup of your site. For more information, please refer to our errata page: WPML custom role based on the editor role cannot edit translations and behave as editor.

If this solution does not seem relevant to your situation, please do not hesitate to open a new support ticket with us for further assistance: Contact WPML Support.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 10 replies, has 2 voices.

Last updated by Mateus Getulio 8 months, 2 weeks ago.

Assisted by: Mateus Getulio.

Author Posts
November 1, 2023 at 4:35 pm

selinav

we have role content manager that were responsible for translation, but after updating they don't have access to posts and pages, just message as example - You don't have the rights to translate from NL to ES

November 1, 2023 at 6:09 pm
November 1, 2023 at 6:20 pm #14709775

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello again,

As we discussed on the chat, please try to replicate the issue on the provided Sandbox and let us know when it is done.

Looking forward to your reply. Thank you.

November 1, 2023 at 7:04 pm #14710019

selinav

I think I found where it comes from. If the user has the role 'Editor', it's ok. But when I create a copy of the role with User Role Editor, it removes the possibility of the current user editing translations, and shows the notice: 'You can only edit translations assigned to you.' I reproduce this issue here: hidden link

November 2, 2023 at 5:06 pm #14719933

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello again,

Thanks for your efforts recreating the issue in the Sandbox.

I have double-checked the problem, but so far I haven't been able to find a fix. I asked my colleagues to take a look to see if there's anything I'm missing.

I'll come back here as soon as one of them answers me (which shouldn't take long). Thank you in advance for your patience!

Regards,
Mateus.

November 3, 2023 at 3:12 pm #14726803

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

I have escalated this ticket to our 2nd tier of support where our 2nd tier specialists will take a deeper look at this issue and will try to find a solution.

I will get back to you as soon as I get an answer from them.

Best regards,
Mateus

November 6, 2023 at 2:06 pm #14738667

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for your patience.

We have found a possible workaround for you. These would be the steps:

- Just make sure to have a complete backup before proceeding
- Go to wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/User.php and change the method - \WPML\LIB\WP\User::isEditor to:

public static function isEditor(\WP_User $user = null) {
		$capability = "editor";
		$capability = apply_filters('wpml_editor_capability', $capability );
		return self::hasCap( $capability, $user );
	} 

- Then, in the theme functions.php file, add this code:

add_filter('wpml_editor_capability', 'my_editor');
function my_editor(){
    $user = wp_get_current_user();
    if (in_array('custom_role', (array)$user->roles, true)){
        return 'custom_role';
    }
}

This in combination with the other document will allow all translation to be processed by other custom roles that you hook using the hook wpml_editor_capability.

Please observe that where we have "custom_role" in the code added in the functions.php file, you will need to replace it with the correspondent name of the custom role you created - content manager, for instance, in the original website.

Right now we're evaluating if this would be a valid feature request to be implemented or not. I'll provide you with updates as soon as we reach to a conclusion.

Thanks again for your understanding and patience.

November 8, 2023 at 6:36 pm #14760521

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Just as a formality, and in order to proceed with the feature request, we need to understand the exact reasons for a custom role in your case (specifically, the content manager user role). May I kindly ask you to tell us a bit more about it?

From WPML 4.6.7 the editor role now has the capability to edit all translation which was possible only with admin roles before this WPML version.

Please let me know about the first question, and if the 'Editor' role would be sufficient in this case.

Looking forward to your reply. Thank you.

November 15, 2023 at 3:30 pm #14811007

selinav

Hello. I compared changes from the previous version, and how I wrote before - noticed that only the admin and editor have capabilities for translating. It's not a good idea for me to change anything in the plugin(after the update I will lose it). Also, now I need to add manually a new translator and assign languages for translating. Before I just changed to a custom role and it works fine. For now, it's not clear to me what these changes are made for.

November 16, 2023 at 12:16 pm #14826333

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thank you for sharing your feedback on the recent WPML updates.

We appreciate your previous response regarding the changes and your preference for the custom role. To ensure we fully understand your needs and can consider them appropriately, I would like to delve a bit deeper into the use of the custom role, particularly the content manager user role.

As mentioned previously, from WPML 4.6.7, the editor role now has the capability to edit all translations, a functionality that was previously associated with admin roles. Considering this enhancement, we are keen to comprehend why the custom role is still preferred in your workflow.

Could you kindly elaborate on the specific requirements or functionalities that the content manager role provides for your translation tasks (or even the general website tasks) that may differ from the capabilities of the updated editor role? Understanding this better will greatly assist us in assessing the necessity of custom roles in your context.

Your insights are invaluable to us, and we want to ensure that any decisions align with your workflow and preferences. Thank you for your time and assistance.

Best regards,
Mateus Getulio

November 24, 2023 at 8:32 pm #14920843

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello and thank you for your patience.

The issue has been reported already and it is currently being worked on.

I will set the current ticket status to "Escalated to WPML developers team" and I will get back to you as soon as I get any feedback from them.

Kind regards,
Mateus

January 19, 2024 at 12:47 pm #15204966

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

For your information, this issue should be fixed in our latest version (4.6.9). Errata page: https://wpml.org/errata/wpml-custom-role-based-on-the-editor-role-cannot-edit-translations-and-behave-as-editor/

Just make sure to have a complete backup, and kindly update WPML. Thank you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.