Closed (fixed)
Project:
WebCalendar integration
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
12 Dec 2006 at 06:45 UTC
Updated:
4 Jun 2007 at 04:29 UTC
Jump to comment: Most recent file
Comments
Comment #1
jaredwiltshire commentedI've got an idea what might be causing this. Please try this version of the file and let me know how it goes.
Comment #2
golson commentedNo change -- same result.
Comment #3
jaredwiltshire commentedHmm. Are you using a fresh install of WebCalendar? If not please try a fresh install.
Since I cannot replicate your problem, it difficult to discern what is causing it.
The error that you are getting is odd. Something is trying to connect to your database with the username ODBC and no password. This is odd because of what you claim your settings are set to.
Comment #4
golson commentedThe calendar install is fresh. I'll dig further into this... Thanks for your help.
Comment #5
golson commentedThe connection seems to have gone away. In user_logged_in(), the failure occurs at #103 -- mysql_query() attempts to establish a connection with default arguments.
If dbi_connect() is called unconditionally #99 (same arguments), things work fine after logging in.
Comment #6
jaredwiltshire commentedSo in other words the database is not connected prior user_logged_in() being called. Hmm.
I got the whole $app_same_db thing from the other user-app files included with webcal, I'll have to check it out and see what is going on.
Comment #7
golson commentedWhat php/mysql versions is this known to work? I have moved everything from a windows to linux server with mysql 5.0.24 and php 5.1.2. Still no luck.
All database/settings parameters work in standalone or other contexts. The integration does not. Is 1.0.4 known to work with mysql 5 and php 5?
FYI:
Comment #8
vlajko commentedI am having identical problem (WebCalendar works fine while standalone, fails after integration with Drupal) on Drupal 5 RC1 / MySQL 5.0.27 / PHP 4.4.4:
Warning: mysql_query() [function.mysql-query]: Access denied for user: 'vkkk@localhost' (Using password: NO) in /home/vkkk/www/drupal5/WebCalendar/includes/php-dbi.php on line 265
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/vkkk/www/drupal5/WebCalendar/includes/php-dbi.php on line 265
Error
Access denied for user: 'vkkk@localhost' (Using password: NO)
SELECT u.uid FROM sessions s, users u WHERE s.sid = '92ae01429b23a0b0b579853a46c03f9a' AND s.uid=u.uid
Comment #9
golson commentedI've found a way to make it work with the following versions:
-- webcalendar 1.0.4
-- php 5.1.2
-- mysql 5.0.24
-- drupal 4.7.4
-- linux
(1) Use a separate DB for webcalendar. Merged databases do not work.
(2) Public access is not handled correctly. user-app-drupal.php refers to $PUBLIC_ACCESS -- which is not defined in webcalendar 1.0.4 (it is in 1.1.1). $public_access is defined in 1.0.4 -- but I'm at a loss to find where it is ever set to anything but 'N'. In any event, I believe $public_access would not be set when user_logged_in() is executed -- it's too early.
Since I want to public to view, but not login into the calendar, I'm using the workaround:
change
in user_logged_in() to
Give the anonynous user 'access webcal' via drupal, and things are set, well, at least for the time being...
Comment #10
hyperlinkedKeeping the Webcalendar DB and the Drupal DB separate didn't do anything for me. I still got the same error.
I employed a crude hack to walk around the issue. Just establish a new connection to the DB.
Find in php-dbi.php:
global $phpdbiVerbose;
Replace with:
global $phpdbiVerbose, $db_host, $db_login, $db_password, $db_database;
if (!$GLOBALS["db_connection"]) {
// if application is in a separate db, we have to connect back to the webcal db
$GLOBALS["db_connection"] = dbi_connect($db_host, $db_login, $db_password, $db_database);
}
Comment #11
nancydruI did what Golson said in #9, but I still get:
I don't know if it matters (I hope not), but I installed WebCalendar before I downloaded this module. [I also fully loaded it up with events and holidays, so please don't make me rebuild it.]
No one seems to have questioned it, but I wonder about the "localhost" designation.
Comment #12
nancydruInteresting. I removed all the changes I made to WebCalendar's "includes" directory and teh calnedar comes up in the correct space in my page. I may not have user authentication, but I can live with that for now (I do want that fixed eventually though).
Comment #13
nawaaz_ahmed commentedI had the same error with web calendar 1.0.4 - I saw an error message "Can't connect to local MySQL server through socket" though the standalone worked fine and the configs in settings.php and user-app-drupal.php were the same.
I got it to work by commenting out the
if ($app_same_db != '1')
part and forcing it to connect always.
/* if ($app_same_db != '1') */ $c = dbi_connect($app_host, $app_login, $app_pass, $app_db);
So I think the problem is that this code i being called before drupal connects to the DB, but the webcal modification assumes that if the DBs are the same it must be connected.
Is there any way of checking if it is connected already before connecting? My change seems to work but I am not sure of any side effects yet.
Comment #14
nancydruI think I see part of the problem in my case:
In
user-app-drupal.phpI see these lines right under the part that is supposed to be customized:Which means, for example, $app_user_table is going to be (and it says this on the error screen) "kappabe_drpl1users"
But my database check screen shows it as "kappabe_drpl1.users"
Unfortunately, changing, for example, 'users' to '.users' didn't cure the problem. Backing out settings.php again.
Comment #15
nancydruHmm, just looked at my logs, maybe this will help: "calendar/function.mysql-query not found"
Comment #16
nancydruWould it help to somehow move my WebCalendar tables into the Drupal database? If so, how would a complete Linux newbie do something like that? I have absolutely no qualms about merging the databases (besides that means only one back up to make).
Comment #17
oneillclan commentedI had a similar problem. I could login to my Drupal site and access the webcalendar. However, I could not view the calendar as an anonymous user even with the public access enabled. As an anonymous user, I kept getting redirected to the Drupal login page. I tried the above mentioned solution of removing "&& $PUBLIC_ACCESS == 'Y'" from my user-app-drupal.php file. This did not work.
As it turned out I originally entered "calendar/" in the webcal path field. I changed that to "/calendar/" and it started working much better. Anonymous users can see the Public Access Calendar and submit events to be approved.
However, as an authenticated user I cannot add events to the public calendar and the public access user does not show up in the "participants list". As an admin, I can approve additions to the calendar can view the calendar.
Is there some easy way to allow authenticated users to add to the public access calendar? I notice prior to the Drupal integration "public access" should up ijn the participants list. It does not appear at this point.
Comment #18
nancydruWell, I keep trying each suggestion and it isn't making a difference.
Comment #19
chlojolo commentedFWIW, I saw this problem as well with a fresh webcalendar 1.0.x and drupal 5.0 install. I added a line
at line 53 and it worked.
I think webcalendar's php-dbi should keep track of whether the database is connected or not, but they may not agree.
Comment #20
nancydruWhere are we at on this one? I'm ready to take this site to 5.1 and really would like to have WebCalendar work right.
Comment #21
jaredwiltshire commentedWebCalendar 1.0.x is no longer supported. Please try using a fresh install of WebCalendar 1.1.2 and feel free to re-open this issue if you are still having problems.
I have tested WebCalendar 1.1.2 using the same database and different databases, using persistent and non-persistent connections and it seems to be working fine.