marxhz
Forum Replies Created
-
I short sidenote related @lymf ‘s usercase.
Since he user with author-roles, my fix will not work. I check if the user have edit-post rights.
@lymf : you have to change ‘edit-posts’ to another right that authors do not have.
Or better, make a real fix so I dont have to ??- This reply was modified 3 years, 9 months ago by marxhz.
I got this too.
The problem seems only to occur when accessing dashboard (i.e /wp-admin/*) pages with non admin users. The PostmanAdmin class is loaded and used even for non-admins. However the dependendat PostmanViewController is not!I made a really quick fix, that works in my usercase there all users are either admin or subscriber. I more robust fix could for sure be made, but sometimes quick’n’dirty is also ok.
In the constructor in PostManAdmin.php I used current_user_can() to prevent PostManViewController from beeing accessed for my subscribers like this:
if ( count( $extensions ) > 0 && current_user_can( 'edit_posts' )) { add_action('admin_menu', [ $this, 'add_menu' ], 20 ); }
instead of this
if ( count( $extensions ) > 0 ) { add_action('admin_menu', [ $this, 'add_menu' ], 20 ); }
A better solution would be not to load PostManAdmin at all for said users, but as I sad: quick’n’dirty ??
Forum: Plugins
In reply to: [WP Document Revisions] Unable to save Workflow State in WP 3.5.1I hade the same problem today, but after some debugging I have found a solution until the author releases a fix:
1. Open the file wp-document-revisions\includes\admin.php
2. Go to line 982
3. Change the or-statement ( || ) to an and-statement ( && )
The row should look like this when you’re ready:
if ( !isset( $old[0] ) && $old[0]->term_id == $_POST['workflow_state'] )