I am developing a new PHPTemplate theme & it mostly works the way that I want, but it seems to be causing a strange problem when I try to log in or out. I am fairly sure it is related to the theme because the problem only happens when my new theme is used.

I am using clean URLs. The problem is exactly the same with IE and Firefox.

Using box_grey as the default theme, if I go to www.mysite.com/user I get a login screen. After entering a valid username and password, I end up on the www.mysite.com/user/2 page. If I click on a link to www.mysite.com/logout, I get logged out and end up back on the front page. Perfect.

However, with my custom theme as the default (and with *no* other changes), after entering the same username and password at www.mysite.com/user, I get stuck on a blank page with the address www.mysite.com/user/login?destination=user. If I then place the cursor at the end of the URL in the address box and press "return", I get redirected to the correct www.mysite.com/user/2 page. If I click on the www.mysite.com/logout link, I get stuck on a blank page again. If I then type www.mysite.com in the address bar, I can see that I have been logged out. There are no errors in the Drupal log.

So, it seems like *something* in my theme is causing page redirects to not work correctly. Any idea what it could be? I have no idea & the only thing that I can think of is to start with a totally clean template & paste in all the new code section by section, retesting every time. That could take days!

Please, any ideas at all? I have searched Drupal & it seems like this may be a similar problem, but so far it has had no replies.

Comments

budda’s picture

Do you use a template.php file in your theme? Only thing I can think of which would kill HTTP page redirects is when there's white space outside of PHP scripts -- usually after a closing ?> tag.

--
Custom Drupal templates | More Drupal modules

ymcp’s picture

Budda... I worship at your feet. :-)

Yes, I have a template.php file, and there was a single space after the closing ?> tag.

All works perfectly now.

I don't know if I would ever have found that myself... thank you so much. :-)