Skip to content Skip to sidebar

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.

Tagged: 

This topic contains 10 replies, has 3 voices.

Last updated by Waqas Bin Hasan 1 year, 11 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 16, 2023 at 3:54 pm #14239455

florianB-12

I am trying to:
Give the Customer (Separate admin User) the option to maintain the Page Menu for all translated languages. My Page uses custom Post types, which should be shown as Menu Items in a Sub Menu. When my Customer opens the Design > Menu Page in WPAdmin, she does not have the custom post type section in the left sidebar of the menu screen.

When I open the menu screen, I have the custom post type section and can add custom post types to the menu as I wish.

My Assumption is, that it is connected to the additional Permitions of the users.
My User aquea-jan has several additional permitions.
The Customer user aquea-marketing does only have one additional permition "translate"
See printscreen "additional-permissions-aquea-jan.jpg" vs "additional-permissions-aquea-marketing.jpg"

Link to a page where the issue can be seen:
hidden link

I expected to see:
All custom post types as sections in the left sidebar of the menu screen for all users having the administrator role. See printscreens "Menu View User aquea-jan.jpeg" vs. "Menu View User aquea-marketing.jpg"

Instead, I got:
Just all default Sections as there would not be any custom post types

I tried to create a new user with the admin role both from the users admin page and also from the wpml translator page, but they always only get the "translate" additional permition.

I have the issue on two separate WordPress instances. If needed, I can create a temporary admin user where you can see the behaviour.

Menu View User aquea-jan.jpg
Menu View User aquea-marketing.jpg
additional-permissions-aquea-marketing.jpg
additional-permissions-aquea-jan.jpg
August 16, 2023 at 6:42 pm #14240795

florianB-12

I have updated to the latest version of WPML and WordPress, the behaviour is still the same..

August 17, 2023 at 2:55 pm #14247197

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Before this ticket gets assigned to my colleagues, I will try to help.

Please visit WPML>>Translation Management>>Translators and add one of the user having issue has Translation Manager. Then make sure is there any difference in the results. Refer to the following documentation URL for more details.

https://wpml.org/documentation/translating-your-contents/working-with-translation-managers/

--
Thanks!

Bigul

August 18, 2023 at 11:14 am #14252041

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support. I am assigned this ticket and 'll try my best to help you fix the problem.

Please let me know about your findings after trying the suggestions, offered by my colleague earlier.

Looking forward.

August 18, 2023 at 11:58 am #14252243

florianB-12

Hi @Bigul and @Waqas,

The user, which is missing the permissions, is already added at WPML>>Translation Management>>Translators and it does not make any difference.

I have also tried to create a fresh user by clicking "Add translator" or "Add translation Manager", which creates a fresch wordpress user in the background. Those new users also just have the additional permission "translate" and not all of them as my initial admin user aquea-jan" has..

August 18, 2023 at 1:05 pm #14252653

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

May I ask you to try the following?

IMPORTANT: Take full backup of your website and database beforehand. It is highly advised to try the following on a staging/dev site first, so your live website isn't compromised.

- Deactivate all plugins except WPML, switch to a standard theme, create a new user like you already tried and check for the issue.
- Then switch back to your theme and repeat the step to check for the issue. This way we'll see if it makes any difference due to the theme.
- Then please activate other plugins one by one and keep checking for the issue.

The purpose is to find any compatibility problem (i.e. conflict) between WPML, themes and other plugins.

Please let me know your findings and I'll try my best to help you further on the matter.

August 19, 2023 at 5:14 am #14255617

florianB-12

As I don't have any staging / dev sites for this customer, it would require a lot of work to duplicate and setup a copy of the site. I cannot do it on the production site as the customer would not allow that.

Luckily, I have just started to work on a third site despro.ch where I copied the theme of aquea.ch and installed all plugins on a fresh 6.3 wordpress. Would it be ok, if I try your Suggestion on the despro.ch website to not touch aquea.ch? As mentioned, I had the problem on several sites, so in my opinion, it does not matter, where I try it..?

August 19, 2023 at 7:21 pm #14257261

florianB-12

Hi Waqas,
I disabled all the installed plugins and switched to the default theme. The issue is still existing.

Additionally, I did the following two test cases with two fresh wordpress installations running the default theme and just having wpml installed:

1. Test Case:

1. Install and Activate WPML
2. Create a second admin user and assign the second user to be a translator
3. The same behaviour as on my customer sites, the second admin user only receives the additional permission "translate"

2. Test Case:

1. Create a second admin user BEFORE installing and activating WPML
2. Install and Activate WPML and assign the primary and secondary admin users to be a translator
3. The Second Admin user receives the same additional permissions as the initial admin user and now is able to also add custom post types within the Menu

Therefore it seems like, that only users, which are create BEFORE WMPL Plugin installation, get the correct additional permissions. This clearly seems like a bug to me.

August 21, 2023 at 9:35 am #14261843

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I tried to reproduce the issue on my side but could not reproduce the issue. However, after discussing with the team, you can try the following workaround:

Add the following code to the theme's functions.php (replace the user ID with your user’s ID), visit any admin page for once, confirm the capabilities in user's profile and then remove the code from functions.php.

function add_capability_to_user() {
    $user = new WP_User( 5 ); //5 is the User ID
    if ( $user->exists() ) {
        $user->add_cap( 'wpml_manage_translation_management' );
        $user->add_cap( 'wpml_manage_languages' );
        $user->add_cap( 'wpml_manage_theme_and_plugin_localization' );
        $user->add_cap( 'wpml_manage_support' );
        $user->add_cap( 'wpml_manage_woocommerce_multilingual' );
        $user->add_cap( 'wpml_operate_woocommerce_multilingual' );
        $user->add_cap( 'wpml_manage_media_translation' );
        $user->add_cap( 'wpml_manage_navigation' );
        $user->add_cap( 'wpml_manage_sticky_links' );
        $user->add_cap( 'wpml_manage_string_translation' );
        $user->add_cap( 'wpml_manage_translation_analytics' );
        $user->add_cap( 'wpml_manage_wp_menus_sync' );
        $user->add_cap( 'wpml_manage_taxonomy_translation' );
        $user->add_cap( 'wpml_manage_troubleshooting' );
        $user->add_cap( 'wpml_manage_translation_options' );
    }
}
add_action( 'init', 'add_capability_to_user' );

On the other hand, if you can provide access to one of your newly created sites, it 'll be great. So I can check for the issue.

I've set your next reply as private to share this information safely.

IMPORTANT: Please take a complete backup of the site to avoid data loss.

Otherwise, you can also use this sandbox site hidden link to reproduce the problem. Do not migrate your site here but feel free to upload your plugin/theme, if necessary.

August 22, 2023 at 2:54 pm #14272357

florianB-12

Hi Waqas,

It turned out, that the problem was the whole time, that in the Screen Options, the Custom Post Type "Produktfamilien" was not selected and that's why, it was not shown to the second admin user.

What is still not ideal in my opinion is, that multiple admin users get different additional capatibilities, depending on, if they are created BEFORE or AFTER WPML installation and activation.

If you want, I can setup two word press instances showing the different capatibilities of the admin users, depending on if they where created before or after WPML Installation?

And additionally it's weird, that for the first admin user, the screen options of the menu screen was different than for the second user..

Thanks and BR
Jan

Pasted_Image_22_08_23__16_50.jpg
August 23, 2023 at 8:06 am #14275455

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Glad to know that you discovered the correct settings in Screen Options. And despite the capabilities this wasn't a problem.

As long as the capabilities are concerned, WPML sets proper capabilities based on the user role (i.e. Translator and/or Translation Manager). This works under the WordPress' roles and capabilities system. And inherits based on that.

Apparently, if you see any difference shown in user's own profile(s), it shouldn't be a problem. As long as the user can "really" do what's the expected.

Since, the CPTs display was controlled by screen options and it is not restricting user to actually use that CPT, I don't see a problem here. The screen options are handled by WP's own system, and the default display may vary depending on CPT's registration. That's why screen options are available to the users, to show/hide allowed content on screen and/or to set some display settings.

In short, I believe this isn't a problem. If, however, you can produce the actual problem based on WPML's capability differences, then please feel free to setup the staging or dev site, provide detailed reproduction steps and we can investigate accordingly.