Note that the custom user role is correctly registered and displays on the User profile selector.
The custom role also display when outputting get_roles().
Hello!
Can you please make sure you’re running the latest version of WordPress (5.6), Yoast Duplicate Post (4.0.1), and the latest version of your theme and other plugins?
If everything’s updated on your end, we recommend performing a conflict check and deactivate other plugins to see if the issue resolves.
Hi,
All plugins and versions are up to date.
The plugin works, the restriction by user role is working for Administrators or other User roles checked in the admin settings.
The custom user role is not displayed in the Roles allowed to copy.
Running get_roles() in the theme, does display the custom user role. It is not available to be checked in the admin panel.
Troubleshooting mode does not resolve the issue.
-
This reply was modified 5 years, 4 months ago by
pragmastef.
Hi @pragmastef,
how did you create the Applicant role based on Editor? Does it have the edit_posts capability?
Hi @lopo ,
Yes the Applicant role has Publishing and Editing capability
The Applicant can Edit post from the front end.
It is just the Duplicate link generated by duplicate_post_clone_post_link() that is not displayed.
The link shows for administrators.
The Role doesn’t show in the list generated in the admin setting
Roles allowed to copy
Administrator
Editor
Author
Contributor
SEO Manager
SEO Editor
Hi @pragmastef
what tool did you use to create the custom role?
Hi @lopo
The custom role was created using code.
The custom role is displaying correctly on the User profile selector.
It is also displaying correctly if outputting get_roles().
Something must not be right in your function generate_roles_permission_list() in src/admin/class-options-form-generator.php
Hi @pragmastef,
you’re right, that’s the part of the code involved but it’s basically the same code that was present in versions from 3.2.3 on so we are not expecting a regression.
Can you show us the code snippet to create the custom role, so we can try to reproduce the bug?
Thanks!
Hi @lopo
The custom role was added by a custom plugin.
I have installed User Role Editor.
Using the plugin, I was able to force the edit and publish_posts to the Applicant role.
This made it visible in Duplicate Options admin.
And the link is now visible in the front end.
It’s a workaround which will work for the moment.
Thanks for looking into it