3

I have a block on one of my sites, in which all content is private. Anonymous users don't see any of my content types, any of my views, blocks, etc.

The problem is one single block. The problem block is the only one not created by a view or a module. I created it simply by adding it via the block page interface. I have set its visibility settings to be restricted to a certain role (not 'Anonymous', of course :-)).

However, this is the one piece of content that is still showing up on my site for anonymous users (before one logs in). I've cleared cache multiple times, so that isn't the issue.

Has anyone else run into this issue? Why would the block not respect the visibility settings? I'm wondering if there are some modules that may be interfering with this or if there's another explanation I'm not seeing....

  • Can you provide screenshot of block settings form. Need to see other settings of block – Eugene Fidelin Jul 20 '12 at 16:26
2

The strangest thing fixed my issue. I'm still not sure why.

I was placing the block in a certain region with the 'Context' module. When I removed the block placement from that context and set it directly in the block's configuration page, the block stopped being visible to anonymous users.

Not sure why that would matter! Placing blocks generated by views with the 'Context' module is not interfering with their visibility settings, but for some reason it was interfering with this one. It's just a regular block with text, nothing funky.

In any case, that's what solved my problem...

0

I had a problem like that in my website which was caused by a totally unrelated module. In my case the coder module caused my admin page to break. But finding the module which caused the problem was very tedious. Just disabling the modules did not work. I had to move each module outside the modules folder, clear the cache and reload the webpage each time I did this. If the problem is caused by a module then you can make modifications as necessary.

  • Thanks for the ideas, Sharanc!! Luckily, I found the culprit. :-) – Boriana Ditcheva Jul 20 '12 at 17:29
0

As per your own answer, it seems that you're using the Context module. That helps to answer to this part of your question:

Why would the block not respect the visibility settings? I'm wondering if there are some modules that may be interfering with this or if there's another explanation I'm not seeing....

Actually, the Context module does not check (take into account) the "Block visibility settings". If you want that to be the case, then you need to use the Context Respect module. Some details about this module, from its project page:

Extends the Context module by making it respect default block settings.

This makes it so you can retain your block visibility when assigning them into various Contexts. You can also 'Override' from the block level to ignore Context Respect.

Alternative to context module

If you're using the Context module (only) to only show some block on selected paths (which you can't specify with the standard block visibility settings), then you may want to have a look at the Rules block visibility module as a valid alternative. Refer to my answer to "How to stop a Views block from displaying to admins, such as user/1?" for more details about it.

By using this module as an alternative, you'd only have to create a Rules Component with Conditions to verify the path(s) on which to show the block, and to check the roles for which you want to show the block, it's that easy ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.