Change WordPress user roles and capabilities › Forums › Bug Reports › Admin profile lost some of the Categories after latest update
- This topic has 11 replies, 3 voices, and was last updated 7 years, 1 month ago by Vladimir.
-
AuthorPosts
-
15/11/2017 at 11:35 #4409sami.niemiParticipant
Hi!
After the latest update users with admin account lost some of the Post Categories in the admin panel. Categories are shown normally if you open the categories page, but they are not shown on any of the listing (like list all posts) or in the dropdown menus (in widgets) or select menus (in selecting a category for a new post).
Some Categories are shown, but not all.Categories are shown normally if you log in using other roles.
Any idea what could be causing this?
16/11/2017 at 07:47 #4410VladimirKeymasterHi,
Do those users has a custom role with administrator privileges or do you write about about users with ‘administrator’ role?
Do you use Edit restrictions add-on? If ‘Yes’, try to deactivate it. Will it help? If Yes, activate this add-on back and re-check if role(s) granted to user is restricted by add-on or user itself has restricted access to posts editing.
16/11/2017 at 09:26 #4412sami.niemiParticipantHi
When logged in as a Administrator (role), some of the categories are missing.
Yes, we have edit restrictions on, but naturally Administrator is set to “allow”. With all the fields left empty.
Administrator should have and full rights, and so it would seem when I check the role’s permissions from the settings.
De-activating edit restrictions didn’t help.
16/11/2017 at 14:32 #4413VladimirKeymasterUser Role Editor (URE) does not set any restrictions for administrator role.
Check if URE deactivation will help to understand that problem is related exactly to URE.17/11/2017 at 09:10 #4417sami.niemiParticipantHi
Deactivating User role editor pro did help. It solved the issue.
Unfortunately after turning it back on, I have the same issue.
And as I said, I can see the Categories in the Categories page and can even edit them. Issue is that that some of the categories are not shown for display or select.
Below there are two sreencaps from the All posts view to demonstrate my point:
– Categories when User role editor pro is disabled and when I’m logged in as an administrator or
when logged in as a editor when user role editor pro is enabled:-Categories when User role editor is enabled and I’m logged in as an Administrator:
https://i.imgur.com/86B5VzR.jpg’
At the same time I can see and edit the categories on the categories page17/11/2017 at 10:15 #4418VladimirKeymasterThanks for the additional details. I meet a such issue the 1st time.
Is it possible to look at your site with ‘administrator’ privileges? If ‘Yes’, send login credentials to support [at-sign] role-editor.com22/11/2017 at 14:47 #4433NewCollege CommunicationsParticipantI am seeing the same error with custom post type taxonomies. this is seen even in the super admin role on a multisite
22/11/2017 at 14:53 #4434NewCollege CommunicationsParticipantGoing back to 4.37 pro fixes the issue
23/11/2017 at 02:40 #4435VladimirKeymasterHi,
Thanks for this information. It seems I could introduce a bug. Can you try a quick workaround?
Open v. 4.38 wp-content/plugins/user-role-editor-pro/pro/includes/classes/post-edit-access.php, go to line #470, where function exclude_terms() is defined. Replace this partif (!in_array($pagenow, array('edit.php', 'post.php', 'post-new.php'))) { return $exclusions; } $terms_list_str = $this->user->get_post_categories_list();
with this version:
if (!in_array($pagenow, array('edit.php', 'post.php', 'post-new.php'))) { return $exclusions; } if (!$this->user->is_restriction_applicable()) { return; } $terms_list_str = $this->user->get_post_categories_list();
Updated version will not apply this restriction to a user with superadmin privileges.
I included this fix to the code and it will be available with the next update. Just wish to test it with your help to be sure, that I identified a problem correctly.23/11/2017 at 03:08 #4436NewCollege CommunicationsParticipantWill do, unfortunately we are on holiday here in the states until the 27th. As always thanks for the awesome support
23/11/2017 at 07:47 #4437sami.niemiParticipantHi
This workaround fixed the issue! Thank you!
I still somehow get Category ID 12 as the default category instead of category ID 1 when making a new post, but as category 12 is not in use, that is not an issue for me.
Br Sami Niemi
23/11/2017 at 10:44 #4438VladimirKeymasterThanks for the help with isolating this issue and testing a fix for it.
Sami, default category is assigned to the post created by super-admin for the same reason. I removed the early current user permissions checking (which were made for any wp-admin page) in v. 4.38, but did not re-check that the same permissions check is done later for the all used hooks.
If there will be a need to fix it before the next update become available, open the same v. 4.38 wp-content/plugins/user-role-editor-pro/pro/includes/classes/post-edit-access.php file, find auto_assign_term() function declaration and add current user permissions checking, like on the image below:
public function auto_assign_term($post_id, $post, $update) {
if (empty($post_id)) {
return;
}
if ($post->post_type=='revision') { // Do nothing with revisions
return;
}
// do not limit user with Administrator role or the user for whome posts/pages edit restrictions were not set
if (!$this->user->is_restriction_applicable()) {
return;
}
$terms_list_str = $this->user->get_post_categories_list();
-
AuthorPosts
- You must be logged in to reply to this topic.