Skip Navigation

[Resolved] Access Not Directing Restricted User to 404 Page

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.90 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 38 replies, has 3 voices.

Last updated by Christian Cox 6 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#512792
BlogArchive Layout.png
HomeArchive Layout.png
BlogArchive Copy Layout.png
Dubble Success Prompts.png

Hi Christian... Thank you for the informative response. Regarding the Blog Archive Layout issue I tried quite a few things including deleting and remaking everything from the page to the Layout, Loops and such. The issue persists.

I did notice one thing that seemed a little odd as I am using the Static Page settings in the WP Reading Settings. The Layout displays Home/Blog. The Layout for the Home Archive page only displays Home. When I copied the Blog Archive Layout it only displayed the Blog. See screenshots.

Lastly I have noticed another anomaly this week. Every time I save I get two success prompts, see screenshot.

Not sure if any of the above mentioned is normal but thought I should bring it all to your attention. So I guess after spending another couple hours with this I am kind of stuck. Would value your assistance with this issue. The issue seems to be related to the activation of Access or the installation of the Beta Views and CRED, can't see anything else that may have changed except that I changed the name of the page and the slug during this time as well.

#513108
01 - Access Removed and logged out.png
02 - Default and custom post types.png
03 - Ticking off Guest causes issue.png
04 - Issue is back.png
05 - My templet setup for all Post Types.png

Addendum to previous post...

I did a complete removal of the access plugin and it's data from the database via the Toolset settings tab. Once removed the bug appears to go away and I can now navigate to the History (Blog Archive) page as expected. When I begin re-setting things up I believe I found what is causing the bug. Whenever I tick off the Guest Read access for any of the Post Types, default or custom, the issue is back.

This is clearly another Access plugin bug, in addition to the first 404 bug, that is being exposed in my setup when a access is active and applied to pages.

P.S. Just so you have it I also included a screenshot of my templet setup for what to display if user does not have read permission. Hope all this is helpful and please advise as to status of fix.

#514208

Hi, our 2nd tier supporters have responded that WordPress redirects found in menu.php of the WordPress core files are responsible for the redirect issue.

$compat = array(
'index' => 'dashboard',
'edit' => 'posts',
'post' => 'posts',

You may remove the redirect action by adding this code to functions.php:

remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

Otherwise, you must use a different page slug for the dashboard.

Quite a few other things going on in this ticket. I'll have to take another look tomorrow, but in the future please open separate tickets for separate issues. Solving more than one problem in a ticket is difficult, and makes the forum hard to navigate.

#514210

Hi Christian... Thanks for the workaround for the "Access Not Directing Restricted User to 404 Page" issue.

1. Is this just a WordPress limitation or will it be fixed by toolset in the future?

2. I am most likely going to direct to a custom templet, which has not had any issues, but a little concerned by your last response. Does this mean I can't use a slug name of "dashboard" or is this just isolated to the issue?

3. In regards to the second part of the Access issue uncovered last week, where the History (Blog Archive) Layout was not being displayed, I believe I have pinpointed it, see previous post. Your timely assistance is appreciated as this issue is holding up some beta work I am doing on a project management system.

Kind Regards,
Dave

#514476

1. Is this just a WordPress limitation or will it be fixed by toolset in the future?
This is how WordPress is designed to work. Toolset will not modify this functionality in a future release.

2. I am most likely going to direct to a custom templet, which has not had any issues, but a little concerned by your last response. Does this mean I can't use a slug name of "dashboard" or is this just isolated to the issue?
As far as I know, problems with the "dashboard" slug are isolated to this issue, but this is probably best answered by WordPress experts in WordPress support forums since it's related to their core code and permissions architecture. I can't say for sure.

I believe I have pinpointed it, see previous post. Your timely assistance is appreciated as this issue is holding up some beta work I am doing on a project management system.
I'll take a look at this now. To reiterate, you will receive the fastest support in the future by creating separate tickets for each issue.

#514483

Hi I just spent some time trying to recreate the Blog Archive layout issue, but I'm having trouble. I can't replicate the duplicate "Settings saved" messages, and I can't replicate the "You need to select a Layout for this page" message.

I have Layouts assigned to my home and blog pages as you've described in the above screenshots. I also created a Layout for Restricted content. I unchecked Guest read access for Pages, and the top of the Read column shows that I have selected to display my Restricted template layout for users without read access. However, I'm not able to replicate the error you're seeing "You need to select a Layout for this page" when I try to visit the home page at mysiteurl.com as a logged-out user.

Could you recreate this on discover-wp.com, or provide step-by-step instructions to replicate the problems on my own environment?

I did notice one thing that seemed a little odd as I am using the Static Page settings in the WP Reading Settings. The Layout displays Home/Blog. The Layout for the Home Archive page only displays Home. When I copied the Blog Archive Layout it only displayed the Blog. See screenshots.
I don't think this is entirely abnormal. I was able to replicate it under these circumstances:
- Start from a new installation
- Reading setting "Your latest posts" is chosen by default
- Create a new Layout for Home/Blog
- Change the Reading setting to "Static page"
- Create a new Layout, this time specific to the Home page archive
- Attempt to duplicate your original Home/Blog Layout. You'll see that you cannot select Home/Blog anymore because these two are now separate.

#514487
No History (Blog Archive) page.png

Just to confirm, you are trying to access the History page (Static Blog page using Blog Archive Layout) when logged out? This is when the issue occurs.

#514512
logged-in-history-pg.png
layouts.png
layout-for-blog.png
history-backend.png
guest-history-pg.png
access-pages.png

Yes, the history page (/history) is not showing the "You need to select a Layout for this page" error message you have described.

I'm attaching screenshots for you to review. You can see my Access settings, layouts list, layout structure, page editor in wp-admin, and logged-in and logged-out views.

Does anything appear to be set differently in your case?

#514529

Hi Christian... Basically you have everything set up the same but I have several custom posts types that are controlled with access and Guest access is ticked off. The Pages post type "Guest Access" is ticked on. The issue happens when ever I tick off the guest access in one of the custom post types.

This whole issue is becoming quite frustrating. I tried completely building a new "Layout for Blog" but the issue persists. I have also done a complete new install with the basics set up but not able to replicate the issue. Not sure where to turn at this point.

So appreciate any assistance you can provide.

#514551

That is frustrating, I hear your pain there. The whole point of our suite of tools is that they should simplify this process, not make it more frustrating, so I apologize that we're not living up to that standard right now. Without being able to access your actual environment or data, I'm a bit stumped since neither of us can replicate the problem. There are simply too many possible variables to consider by exchanging screenshots. With that in mind, I have a few alternate debugging options for you to consider:

- You may clone your site with the layout problem and install it on another environment. Manually remove any sensitive data I should not have access to, then clone the pared down version so I can install and test it.
- Use Toolset > Export / Import tools to export your Types, Views, Access, and Layouts settings so I can port them into my local environment. This won't export actual post content, but will allow me to access your exact configurations locally.
- Install and use Toolset Module Manager to export entire modules I can install on my own site. Export everything you can, including Layouts, Post Types, Access settings, Views, Content Templates, Taxonomies, CRED forms if you have them, and so on.

#514563

Hi Christian... Thank you for your consideration and helpfulness. Firstly, Toolset is an amazing suite of tools and you and the rest of the team are amazing as well. While this is frustrating and I hope we can get to the bottom of it there is always the possibility it is operator error on my end.

I did a quick Access export and import settings test on the fresh WordPress install from a couple hours ago and the issue is present now. If you provide me with the proper way to transfer the Access export zip file to you, I will get it right over.

#514596
STEP 03.png
STEP 04.png
STEP 06.png

Addendum To Previous... After doing as you suggested, exporting the Access settings and seeing that the issue showed up on a fresh WordPress install, I decided to do a little more study of the issue. I believe I was able to zero in on the actual Access setting that is causing us all the grief.

:::::::::::::::: STEPS TO REPRODUCE ISSUE ::::::::::::::::
The following steps were done on my original site after fully removing all Access data, the plugin and reinstalling it. I logged out and tested the site after each step until the issue showed up. Once I was able to cause the issue I went a little more granular and pinned it down to the Archive setting in the Post Types Read settings.

STEP 01 Deleted all access data from database and uninstalled plugin.

STEP 02 Reinstalled Access plugin.

STEP 03 Ticked on "Managed by Access" for the Pages post type.

STEP 04 Made Post Group, assigned to two of my pages and ticked off access for Guests. Also assigned the Read setting to display my custom Templet Layout.

STEP 05 Activated "Managed by Access" for my custom post type Projects and ticked off access for Guests.

STEP 06 In my custom Post Type "Projects" I assigned both Read display settings to use my custom Templet Layout. It is at this step that the issue pops up and it is clearly related to the activation of the Archive setting to my custom Templet Layout.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

I hope all this is of help and let me know if you would like the Access settings export zip file.

Kind Regards,
Dave

#514887

Perfect - I'm able to replicate this now. I do not think I need the zipped up settings since I have everything recreated here now. I'll update you shortly.

#514908

Okay another quick update. I was able to replicate this reliably, and I also found that steps 3 and 4 were not necessary for me to replicate the problem. I've escalated this issue to our 2nd tier supporters as well for some clarification. I'll update you as soon as I hear something from them.

#514922

So glad we found the bug... Now we can squash it. Let me know when you have something further and thanks for all your help along the way.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.