Magic tabs do not work for anonymous users when caching is enabled

yngens - July 2, 2008 - 21:44
Project:Magic Tabs
Version:5.x-1.x-dev
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Everything is working all right for authenticated users on my site, but whenever anonymous user presses any other (than displayed on first load) tab, all the tabs disappear. I could not find any settings or permission setting page for the module.

#1

amariotti - July 3, 2008 - 15:31

What are you displaying in the tabs? The content might be blocked by access control. (i.e. access all views)

#2

yngens - July 4, 2008 - 00:26

Thanks for the reply. I display views, but none of my views are access restricted.

I have narrowed the issue to Firefox browser of 2.0.0.15 version (haven't tested on earlier versions). In IE anonymous users can select tabs and view their content normally. But in FF whenever you select any tab, all the tabs are gone instantly.

#3

yngens - July 4, 2008 - 00:42

I have just tested on Epiphany and Opera in Ubuntu. Unfortunately magic tabs for anonymous users failed on both browsers. I wonder if someone else could confirm this or this issue is specific to may Drupal installation?

#4

yhager - July 4, 2008 - 03:03

Opera on Linux works fine for me with the example callback.

#5

brenda003 - July 8, 2008 - 14:30

yngens, what's your server specs? PHP version, etc? Any errors in the logs? It seems like we're suddenly having the same issue.

It only happens for anonymous and in the logs I see:

[Tue Jul 08 09:24:41 2008] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_HOST in /xxx/includes/bootstrap.inc on line 204
[Tue Jul 08 09:24:41 2008] [error] [client 127.0.0.1] PHP Notice: Undefined index: HTTP_HOST in /xxx/includes/bootstrap.inc on line 261

And these lines say:


204. $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
261. $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']);

#6

yhager - July 8, 2008 - 15:00
Status:active» postponed (maintainer needs more info)

@brenda003, @yngens: I cannot see how this is related to magic_tabs, but it seems to be somehow. I can't recreate it, so your help in finding further details on this will be highly appreciated.

#7

brenda003 - July 9, 2008 - 05:07

Well, I'm also hitting this:

User tried to use a callback xxx_blocks_author_tabs without it being registered first.

So the callback is not registered for some reason.

#8

brenda003 - July 8, 2008 - 15:44

Hmm, it seems to be working now... though I see this has been occurring for at least a week, maybe off and on. Still looking into why.

#9

brenda003 - July 8, 2008 - 15:56

The bootstrap.inc notices seem unrelated. oops :|

Lots of those callback errors in my watchdog, though.

#10

yhager - July 8, 2008 - 16:08

User tried to use a callback redroom_blocks_author_tabs without it being registered first.

The callback registration was added as a security mechanism to prevent arbitrary callbacks being used by malicious users. Clearly this is not the case here, but I am curious why it was triggered.

#11

yngens - July 8, 2008 - 22:07

reply to #5

my specs are:

Drupal 5.8-dev
File system Writable (public download method)
JQuery Update Installed correctly
The current installed version of JQuery is 1.1.2
MySQL database 5.0.51a
MySQL database for event module 5.0.51a
PHP 5.2.6
PHP register globals Off
Unicode library PHP Mbstring Extension
Web server Apache

The issue is gone for me after yhager suggested to clear cache memory. But I am not sure it won't appear again.

#12

peach - July 16, 2008 - 12:30
Title:Magic tabs do not work for anonymous users» Magic tabs do not work for anonymous users when caching is enabled
Priority:normal» critical

Same problem here. This problem is probably cache related because it works fine when caching is disabled.
When I turn on "normal caching" the tabs will disappear for anonymous users when the click a tab. It doesn't happen immediately after turning on the cache but after a while, probably when certain pages are cached that are called by the tabs?

I've tried the suggested solution of clearing the cache but as expected this only solved the problem temporarily, as the cache wont stay clear forever.

Hopefully we can get this fixed soon because turning off caching makes drupal very slow and resource-hungry.

#13

yhager - July 16, 2008 - 13:00
Status:postponed (maintainer needs more info)» active

@peach - thanks for the pointer.

This behavior was added with the recent security fix, that require callback registration. When pages are being served from the cache, the callbacks are not being registered, and the module refuses to run the (unregistered) callback.

I need to find a way to solve this without compromising on security..

#14

yhager - July 17, 2008 - 18:16
Status:active» fixed

Fixed. (http://drupal.org/cvs?commit=128161)

Thanks all for you help in figuring this one out.

#15

yngens - July 18, 2008 - 04:53

i tried the last updated version and unfortunately it became even worse for me - if before the problem was effective only for anonymous users, now tabs started to disappear for authenticated users too.

#16

yhager - July 18, 2008 - 05:53

You *MUST* clear the cache after you upgrade. I forgot to mention that before.

PS - Do not edit your messages, as I might miss the update this way. I saw it by chance.

#17

peach - July 20, 2008 - 09:29

Great to see this fixed!

The fix seems to have worked fine and I will be cross-browser testing it for a few more days to make sure.

btw, lately I've seen soem blog posts about this module called quicktabs on Drupal Planet, which seems cool but;
1. it doesn't do AJAX loading
2. it leaves your non-javascript users with a broken site

I think you should write a blog post for this module as well, this module has really been one of my favorites lately.
If you don't have a blog I will write a nice blog post for you (on alldrupalthemes.com).

#18

yhager - July 20, 2008 - 09:41

@peach: Thanks for your offer, that would be very kind of you :)

I am not really a blogger, so any help spreading the word will be greatly appreciated!

#19

Anonymous (not verified) - August 3, 2008 - 09:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.