Base URL Multisites

pkrasko - February 21, 2007 - 23:06
Project:Chatblock
Version:5.x-1.0.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:dwees
Status:closed
Description

Hi,

I installed the chatblock module and I entered the base URL which happens to be an alias, so it does end in a trailing /. I got an apache file not found error - it can't locate chatblock/views. I then searched my entire drupal install directory and folder views is no where to be found. Should there be a views folder??

If it was supposed to create a view folder and it puts it in the drupal root directory how would this module work with multi-sites?

phil

#1

dwees - February 21, 2007 - 23:21
Assigned to:Anonymous» dwees
Status:active» closed

What happens is the chatblock module attempts to find a file at http://www.yourbaseurl.com/chatblock/view and Drupal automatically redirects this file search to the appropriate function. You won't find that url anywhere in the module, it's what is called a 'callback' to a function (search for MENU_CALLBACK for more information).

If you have a trailing slash in your URL, then Drupal tries to find a file at http://www.yourbaseurl.com//chatblock/view, which doesn't exist. So you get a 404 error, file not found.

Part of the problem is that I had trouble coding for the base url of a page, and I needed to set up a base url that would work on all pages AND it's not required that you enter this url for Drupal to work properly. If I could solve that issue, then I could remove this setting entirely, but until I figure out how to do that, you'll have to make sure you enter a URL without a trailing slash or wait for this module to have all the kinks ironed out.

#2

pkrasko - February 22, 2007 - 17:23

Thanks for the response.

I just tried this module on 2 different servers (windows apache 2.0 and bsd apache 2.2) with no luck. I went into your module and printed out the $url so I can see exactly what was happening.

My url that is printed seems correct with no trailing slashes. [http://www.myexample.com]

However I am still getting a file not found error in my chat block:
Not Found
The requested URL /chatblock/view was not found on this server

So it seems that your menu callback isn't working. "Drupal automatically redirects this file search to the appropriate function."

Any ideas??? I am hoping to get this resolved today...

thanks,

phil

#3

pkrasko - February 22, 2007 - 18:04

More information to help you debug.

In the .module file:

function chatblock_menu($may_cache) {
global $user;
$items = array();
$items[] = array(
'path' => 'chatblock/view',
'title' => t('chatblock'),
'callback' => 'chatblock_chat_callback',
'access' => user_access('access content'),
'type' => MENU_CALLBACK
);

I printed out these values to the page:
Array ( [path] => chatblock/view [title] => chatblock [callback] => chatblock_chat_callback [access] => 1 [type] => 4 )

MENU_CALLBACK is returning an int. I'm not sure if that is correct, but we know that chatblock/view should call chatblock_chat_callback which isn't happening.

#4

pkrasko - February 23, 2007 - 20:16
Status:closed» postponed (maintainer needs more info)

Please read 2 posts above...

#5

dwees - March 5, 2007 - 13:10

Are you using clean urls or not?

If you are using clean urls, then I'd need to have access to your website where you are testing this so I can see the page source etc... play around with different settings.

If you are not using clean urls, then you can try modifying the dir to something like http://www.example.com?q= and see if that works.

Dave

#6

pkrasko - March 5, 2007 - 17:24

I fixed this problem by editing your module file and adding 'q=' before all the paths.

I do not have clean urls enabled.

#7

dwees - November 6, 2007 - 16:53
Status:postponed (maintainer needs more info)» fixed

This module should now work whether or not clean-urls are enabled.

Dave

#8

Anonymous - November 20, 2007 - 17:03
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.