Change WordPress user roles and capabilities › Forums › Bug Reports › User Access restrict to return 404 error
Tagged: post view restriciton
- This topic has 23 replies, 2 voices, and was last updated 8 years, 7 months ago by
Vladimir.
-
AuthorPosts
-
10/04/2017 at 16:45 #3549
Vladimir
KeymasterI got a theme copy. Thanks. I will test it tomorrow.
10/04/2017 at 16:54 #3550gcacciola
ParticipantFound it! I went to user-role-editor-pro/includes instead of /pro.
I thought that pro on the beginning was the ending of “user role editor pro”.
Well, sent you the copy.
I did the coding you told me on line 166, but it didn’t work 🙁
Still getting a blank page. the 404 is missing ( lol, the 404 is 404 hahhhaa)
10/04/2017 at 16:57 #3551Vladimir
KeymasterCoding you made is related to the default value for a new added post bug you discovered recently.
I will try to repeat the 404 issue with your theme tomorrow and search a solution in case of success.
10/04/2017 at 17:01 #3552gcacciola
ParticipantOps! Sorry, my bad! I am getting confused already!
Well, in that case, I can confirm that it worked. I created both new page and new custom post type article, and they came with 404 marked as default after the coding! Great job!11/04/2017 at 08:59 #3558Vladimir
KeymasterHi Giacomo,
Good news – I repeated a described issue. Trying to open prohibited by URE (action HTTP 404) page with active wOffice 2.4 does not show theme’s 404 page. Trying to open really unexisted page shows theme’s 404 as expected.
So I will investigate a reason of this conflict and contact your then, may be tomorrow.
11/04/2017 at 12:39 #3560gcacciola
ParticipantGreat, I am not doing anything wrong then.
It is horrible when we describe bugs that cannot be reproduced.
I am glad you will look into it. Thank you so much.13/04/2017 at 02:12 #3565Vladimir
KeymasterHi Giacomo,
A quick fix for the empty 404 page problem is to add lower priority to the URE Pro’s post filter. You can open user-role-editor-pro/pro/includes/classes/content-view-restrictions-posts-list.php and replace line #17
add_action('pre_get_posts', array($this, 'hide_prohibited_posts'));with this version
add_action('pre_get_posts', array($this, 'hide_prohibited_posts'), 100);A reason of this conflict the woffice theme applies its posts restrictions filter even if restricted posts list is empty. Applying this filter theme overwrites the same filter set by URE Pro little earlier. So a restricted page exists for WordPress and WP tries to show it, but with empty content as URE does not allow to view content of restricted post here too.
17/04/2017 at 18:56 #3571gcacciola
ParticipantGreat, it worked perfectly. Will it be embedded on a future update?
Regards.
Giacomo
18/04/2017 at 00:48 #3572Vladimir
KeymasterHi Giacomo,
Thanks for the feedback.
Yes, I included this fix to the code. I will publish it with the next update. -
AuthorPosts
- You must be logged in to reply to this topic.