After upgrading from Beta1 to RC1 I got the Open Basedir errors below. I'm using Blue lagoon, with adapted tpl.php files in my main theme dir. Blue lagoon is selected ok in settings and stylesheets are read as normal.

* warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/advanced_forum-structure.css) is not within the allowed path(s): (/home/vhosts/xxx.org/httpdocs:/tmp) in /home/vhosts/xxx.org/httpdocs/sites/all/modules/advanced_forum/advanced_forum.module on line 1446.
* warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/advanced_forum.css) is not within the allowed path(s): (/home/vhosts/xxx.org/httpdocs:/tmp) in /home/vhosts/xxx.org/httpdocs/sites/all/modules/advanced_forum/advanced_forum.module on line 1446.

I'm at a loss for what can cause this error. Something with themes I guess.

Comments

michelle’s picture

I've seen that before, long ago, and I bet I caused it again when I changed how it finds the theme. I'm not feeling up to hunting it down at the moment but you may find a fix if you search old issues.

Michelle

dries arnolds’s picture

Hi Michelle, thanks for your reply. The old issues that make note of this error all refer to the 'path_to_theme', but since it isn't used anymore in the last version(s) I think it's not something I can solve with the solutions in the old issues.

I tried moving the css files around placing them in several theme locations and removing them in others, but it doesn't help.

Ingumsky’s picture

The same for me while using garland -( Moving css files didn't help me.

prapse’s picture

Version: 6.x-1.0-rc1 » 6.x-1.x-dev

got the same error, so it is theme related (using 4seasons)

* warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/advanced_forum-structure.css) is not within the allowed path(s): (/www/htdocs/*****/:/tmp:/usr/bin:/www/htdocs/*****:/bin:/usr/local/bin:/usr/share/php) in /www/htdocs/*****/modules/advanced_forum/advanced_forum.module on line 1446.
* warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/advanced_forum.css) is not within the allowed path(s): (/www/htdocs/*****/:/tmp:/usr/bin:/www/htdocs/*****:/bin:/usr/local/bin:/usr/share/php) in /www/htdocs/*****/modules/advanced_forum/advanced_forum.module on line 1446.

i really don't know what to do to fix :)

dries arnolds’s picture

I'm using a custom built theme based on a framework (not a subtheme), so it's not specific for any theme I think.

michelle’s picture

Title: Open Basedir error after upgrade to RC1 » Fall back to site default theme when no $theme available
Assigned: Unassigned » michelle
Category: bug » task

Frankly, what you folks are telling me is impossible and I have no clue how it could be happening. Essentially you're saying that the theme system is not initialized within the theme system. Given that debugging something that is impossible is beyond me, I'm simply going to bandaid it. If it can't get the theme from the global variable, I'll fall back to pulling it from the database.

Michelle

Ingumsky’s picture

Hmmm... It's quite interesting I think — my site's mirror on my local machine (LAMP) with absolutely identical site structure, set of modules enabled, base dump etc etc works fine without any open_basedir errors occurring!

naheemsays’s picture

Adding more info to this, the css file overriding does not work either.

Placing separate css files within the theme directory to override those that come with the module does not work and the original files are loaded.

As a short hack, is there a way to suppress the error messages from showing for normal users?

michelle’s picture

nbz: If it can't find the theme directory, you can't really expect it to find files in the theme directory.

If I can get to the Y today, this is first on my list to fix.

Michelle

naheemsays’s picture

Thanks. If you need any more info, I will keep monitoring this issue.

(My first post was more or less a "subscribe", but potentially with more info.)

michelle’s picture

Well, the info I need is the reason why it's happening which no one has been able to provide. My "fix" will be a bandaid, treating the symptoms, because I have no idea why some people are having the impossible happen. There should be no way that the global theme variable is empty when called from within the theme system and yet, somehow, it is for some people. I'd love to find out why but I can't reproduce this problem. So all I can do is work around it.

Michelle

naheemsays’s picture

I have added a drupal_set_message to the _advanced_forum_add_files and advanced_forum_path_to_theme functions and from what I can see, the global $theme variable is available on the node pages but not on the forum list and forum topic list pages.

michelle’s picture

Really? And other people were reporting problems on the node pages. Very strange. The forum/topic list one is at least possible since that's not being called from within a preprocess. It's the node page issues that are "impossible". I still don't understand why though. Only a handful of people have this problem and I'm not one of them. What would be different from site to site to affect the availability of that variable there? It's quite bizarre.

Anyway, I'm at the Y so I'll get the bandaid in. If someone can come up with a real fix I can always change it later. For now, I want to get a working RC2 out. It's been delayed longer than I wanted it to due to illness and personal stuff.

Michelle

Ingumsky’s picture

Status: Postponed (maintainer needs more info) » Active

>> the global $theme variable is available on the node pages but not on the forum list and forum topic list pages
> Really? And other people were reporting problems on the node pages. Very strange.
I have these errors appearing on the "Forums" list page and on the lists of topics only. Node pages are virgin white.

I've tried to run phpinfo on my local machine and on production site. There's no Local or Master values set on my local server for open_basedir but both of them have been set to "/var/www/virtual/EXAMPLE.NET/:/usr/share/php/" on that troublesome one (obviously EXAMPLE.NET is just a token).

Thank you Michelle!

michelle’s picture

Status: Active » Fixed

Ok, band-aid committed. One caveat: If you are one of the people with this issue and have multiple themes enabled, this will fall back to the default theme.

Michelle

naheemsays’s picture

Status: Fixed » Postponed (maintainer needs more info)

I can't seem to find the commit in the CVS log.

michelle’s picture

Status: Active » Fixed

Very strange... Must have been some hiccup in cvs. I just committed it again and it looks like it went thru. Thanks for letting me know.

Michelle

naheemsays’s picture

Just upgraded to rc2 and I realised that the css handling is still not working for the forum topic list page on my live site (it works for the node page and I never checked on the forum list page), but the error messages as shown before no longer show.

naheemsays’s picture

Status: Fixed » Needs work

Just found the bug. The lines of code you added were:

  $default_theme = variable_get('default_theme', 'garland');
  return drupal_get_path('theme', $default_theme);

but they should be

  $default_theme = variable_get('theme_default', 'garland');
  return drupal_get_path('theme', $default_theme);

The code is around line 1189 of advanced_forum.module. The original error message was hidden by the code because since there was no variable called default_theme, the module checked in the themes/garland folder for the relevant files.

PS thanks for this module - I have migrated from my custom setup for the forums I had from a year or so ago to advanced_forum and most people are happy with the change.

michelle’s picture

Category: task » bug
Status: Needs work » Reviewed & tested by the community

Doh! I tried commenting out the global $theme part to "fake" the problem since it never happens on my site... But my default theme is Garland.

When I saw your post the other day I just whined about it a bit to merlinofchaos and put it on the back burner because I had absolutely no clue what to do if pulling it right out of the database didn't work. I'm glad you figured it out. :) I'll get it committed before RC3 (sigh... I was hoping I wouldnt' need RC3... Dang bugs)

Thanks,

Michelle

michelle’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Michelle

Ingumsky’s picture

Thank you lads!

michelle’s picture

Lads? LOL! Last I checked I was a woman, and not plural. ;)

Michelle

Ingumsky’s picture

*blushes*
Ugh... I'm sorry Michelle... I... I mean... Ugh... That bloody message was for you and nbz both but anyway that was horrible miss (or should I say "That was horrible, miss"? 8-) Blame on me, blame on!

michelle’s picture

Oh, oops. I didn't look that close as to what issue this was and didn't realize that was aimed at nbz. Sorry. :)

Michelle

Status: Fixed » Closed (fixed)

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

jdblank’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Priority: Normal » Critical
Status: Closed (fixed) » Active

We have installed the latest version of Advanced forums and it just can't seem to find the theme files or tpl pages. It seems similar to the problem described in this post that is why I am reopening this issue.

Any help would be much appreciated.

michelle’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Priority: Critical » Normal
Status: Active » Closed (fixed)

There's no way it could be the same as this 1.x bug that was fixed last March because the problem code doesn't even exist in 2.x. Please open a new support request and give some details otherwise I'm not going to be able to guess why it's not finding your style.

Michelle