I updated from 6.x-1 to 6.x-2, and then to the Dev release.

I copied the chatroomread.php to the drupal root, just as I have with other versions. Yet Drupal is complaining with the above error in the Status report. The Chat 'seems to be functioning correctly. It's updating as you'd expect, but Drupal is still reporting this error.

6.x-1 worked fine.
6.x-2 and the dev release error.

I do have an alias redirect on my website, if that will affect youe code at all.

Comments

Anonymous’s picture

hmm, not sure. could you give me some more detail about the alias redirect? do you mean apache level, or via a drupal module?

ElgarL’s picture

The redirect is Apache level, so should be transparent to drupal. chatroom worked on the previous release. It works now, all except the error.

http://palmergames.com/ is the site.

The redirect will send you automatically to http://palmergames.com/drupal

Watchdog has in it's logs 'file not found chatroomread.php' and the URL for it of - http://palmergames.com/drupal/chatroomread.php

if you click the link to chatroomread.php it shows a blank page, so you can clearly see the file is there and where it shoudl be (as it was on the other versions).

Love the module though. If I could just get rid of this silly error.

Anonymous’s picture

can you try putting this following line in chatroom.install, around line 438. change this:

    // Webroot equals document root plus $base_dir
    $where_chatroomread_should_be = $_SERVER['DOCUMENT_ROOT'] . $base_path . 'chatroomread.php';
    if (!file_exists($where_chatroomread_should_be)) {

to this:

    // Webroot equals document root plus $base_dir
    $where_chatroomread_should_be = $_SERVER['DOCUMENT_ROOT'] . $base_path . 'chatroomread.php';
    drupal_set_message($where_chatroomread_should_be);
    if (!file_exists($where_chatroomread_should_be)) {

and report back? do you have $base_url set in settings.php? if so, what is it set to?

ElgarL’s picture

The output = /var/www/palmergames.com/drupal/chatroomread.php
This is wrong however. This is a multisite install.
It should be = /var/www/drupal-6.17/chatroom.php

My apache alias = Alias /drupal "/var/www/drupal-6.17"

$_SERVER['DOCUMENT_ROOT'] is returning = /var/www/palmergames.com

This is wrong for a file path as it should be locating the Drupal root, not the web root.

.$base_path is returning the web alias /drupal This should only be used in a web URL, not a pathing quiery.

If I create a /drupal in the multisite root and place chatroomread.php in it, the error goes away.
It is confusing and mixing paths and web URL aliases

I also have no setting for $base_url in the settings.php.

Unless I'm in error, should it not be looking in the drupal folder? not a sub folder within a multisite folder? A sub folder would mean making a copy of the file and folder in every site that wants to use chatroom.

ElgarL’s picture

If I change


$where_chatroomread_should_be = $_SERVER['DOCUMENT_ROOT'] . $base_path . 'chatroomread.php';

to this


$where_chatroomread_should_be = 'chatroomread.php';

This check performs correctly. It's executed from index.php so is already at root and drupal handles the pathing.
Can I ask why it requires a copy at root? Would it not be easier to modify the modules call to execute the php in the module directory?

Anonymous’s picture

thanks for the information. can you try this, change the line that sets $where_chatroomread_should_be to:

    $where_chatroomread_should_be = dirname($_SERVER['SCRIPT_FILENAME']) . '/chatroomread.php';
Anonymous’s picture

have a look at this issue, and my replies:

http://drupal.org/node/789288#comment-2937946

in a nutshell,

a) there are many valid places to install chatroomread.php, so the path between it and the base of the install can't be hardcoded
b) when chatroomread.php first runs, we don't have access to the global $conf array, so we can't use that to set the path to base of the drupal install
c) we can't trust a path sent back to us over the wire, so even if we do the standard validation of a path, we can't trust that the bootstrap code we include is drupal's bootstrap code

ElgarL’s picture

Thats perfect. The correct documet root for a multsite install.

/var/www/drupal-6.17/chatroomread.php

Anonymous’s picture

Status: Active » Fixed

ok, fix committed here:

http://drupal.org/cvs?commit=392150

probably won't roll a new release for a week or so. thanks again for the report.

Status: Fixed » Closed (fixed)

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

bagusflyer’s picture

I got the same problem when I installed chatroom-6.x-2.14 in drupal 6.20. Any solution?

SarangPSL’s picture

Status: Closed (fixed) » Needs work

Even I am facing the same thing with Drupal 6.19. Any woraround/ fix?

hallswah’s picture

i have a slightly different problem:
there is no chatroomread.php in the
sites/all/modules/chatroom
version 7.x-2.0-alpha1

anyone else experiece this?

Anonymous’s picture

Status: Needs work » Closed (works as designed)

@hallswah - that's by design, chatroom 7.x-2.x doesn't use chatroomread.php anymore.

hallswah’s picture

Version: 6.x-2.x-dev » 7.x-2.0-alpha1

Thankyou for the reply,

I'm still puzzled as when I click the "Start a Chat" link, I get a white screen and nothing else.
I'm obviously doing something wrong but cant work out what it is.

Any further help would be much appreciated.

zabej’s picture

Yes, I have the same issue

"I get a white screen and nothing else"