Closed (fixed)
Project:
Chatblock
Version:
5.x-1.0.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
21 Feb 2007 at 23:06 UTC
Updated:
20 Nov 2007 at 17:03 UTC
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
Comments
Comment #1
dwees commentedWhat 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.
Comment #2
pkrasko commentedThanks 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
Comment #3
pkrasko commentedMore 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.
Comment #4
pkrasko commentedPlease read 2 posts above...
Comment #5
dwees commentedAre 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
Comment #6
pkrasko commentedI fixed this problem by editing your module file and adding 'q=' before all the paths.
I do not have clean urls enabled.
Comment #7
dwees commentedThis module should now work whether or not clean-urls are enabled.
Dave
Comment #8
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.