ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Calendar module gives mysql errors in side menu


  • 2006-07-26 14:43:45

    Calendar module gives mysql errors in side menu

    Hi, I have just installed Atutor, and then shortly afterwards Webcalendar and the calendar module. Atutor appears to be working fine, as does Webcalendar, the module appears to behave fine from the admin controls etc, but when setting it to appear in the side menu, I get mysql errors as defined below. Mysql is extensively esd on this server, so I believe it is either my setup of this particular DB (ie webcalendar or an issue with the module maybe, or could it be the authentication to webcalendar from Atutor?

    any help or suggestions would be much appreciated: details are below.

    regards
    Paddy

    If you are asking for help, provide lots of detail so problems can be reproduced.

    Things to describe:
    operating system - OS X Server v10.3.9
    version of ATutor -1.5.3.1
    versions of php -4.3.10
    version of mysq l -4.0.13
    webserver & version -Apache 1.3.33
    copies of error messages - this was in the side menu area which should have held the calendar events:

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 9

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 10

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 15
    Today is: 26-Jul-2006 (Links open in a new window.)

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 21

    changes to default settings -none that I know of
    web browser being used -safari/Firefox

    and anything else relevant -
    the calendar appears to work fine in the main window, and in the line in the error message that says
    Today is: 26-Jul-2006 (Links open in a new window.) the date is a functional link which launches the calendar in the main window

  • 2006-07-26 17:40:00

    Re: Calendar module gives mysql errors in side menu

    You found a bug

    In 1.5.3 the login name was changed to display the users real name if it exists, or their login name otherwise. To fix this add the following query at about line 15 in the side_menu.inc.php file

    [php]

    $sql2 = "SELECT login from ".TABLE_PREFIX."members WHERE member_id ='$_SESSION[member_id]'";
    $result10 = mysql_query($sql2, $db);
    while($row2 = mysql_fetch_row($result10)){
    $this_login = $row2['0'];
    }

    [/php]

    Then replace occurances of $_SESSION[login] with $this_login.

  • 2006-07-26 18:01:37

    Re: Calendar module gives mysql errors in side menu

    Or download the updated webcalendar module from:

    http://www.atutor.ca/atutor/modules.php

  • 2006-07-27 03:50:13

    Re: Calendar module gives mysql errors in side menu

    HI, I just downloaded the new module and copied the side_menu.inc.php over to the existing one - Or did you mean for me to reinstall the module completelyagain? - changing just the side_menu.inc.php didn't fix the problem - I still get errors at each line where a mysql query is attempted (except line 31 it seems) see below
    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 9

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 10

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 15

    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 16

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 21
    Today is: 27-Jul-2006 (Links open in a new window.)

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 27

    should I delete and replace the module entirely?

    regards

    Paddy

    [reply][b]In reply to:[/b]
    You found a bug

    In 1.5.3 the login name was changed to display the users real name if it exists, or their login name otherwise. To fix this add the following query at about line 15 in the side_menu...
    [op]forums/view.php?fid=7;pid=8487;page=1#8488[/op][/reply]

  • 2006-07-27 08:53:05

    Re: Calendar module gives mysql errors in side menu

    I'm not sure what to tell you now. It's all working fine on our servers. You can see it working on our demo site.

    There seems to be an issue with you database connection. I could see a single query to the database failing, but not all of them.

    Have you installed the Webcalendar tables into the same database ATutor is in?

    Replacing the file should be all you need to do. There were no changes to other files

  • 2006-07-27 09:26:42

    Re: Calendar module gives mysql errors in side menu

    Hi, thanks for the reply - Webcalendar tables are in the same database as ATutor, and the calendar works fine within Atutor when viewed in the main window (group events and individual ones show up fine), it's only calling the next events in the sidemenu that is giving the issue - I will have a look and see what the queries do in mysql directly. If I find an answer I will send it to you.
    (could there be a permissions problem? - it looks like its something I ahve either done, or not done, so I will review the entre install.

    Paddy

  • 2006-07-27 17:16:47

    Re: Calendar module gives mysql errors in side menu

    If you are able to access events through the main calendar, its unlikely there is a permission problem.


    Please do let us know if you discover the problem.

  • 2006-07-28 02:30:38

    Re: Calendar module gives mysql errors in side menu

    So far - if I run the querys which get reported as problems directly within cocoamysql (a gui for mysql on OS X) , with appropriate replacement of variables for real values, then I get the right output, so its almost like its the either the variables or syntax going into the query from Atutor which it doesn't like?
    Also, under manage calendar , I have noticed that when I hit sync databases now, I don't get a sucess screen appear as before, just a blank, similarly with the admin screen allowing change of url (the URL is right, but its interesting the option screen won't appear. This did work originally.)
    I have also tried removing the module entirely and reinstalling with the latest one - no difference. So I think perhaps I should remove the module again, then remove the webcalendar tables from the DB and reintall this too?

  • 2006-07-28 04:10:47

    Re: Calendar module gives mysql errors in side menu

    also: echoing some of the variables back to the same sidemenu didn't give me a value for $db but did for other items see below

    $sql=SELECT * from AT_config WHERE name="webcalendar"
    $db=
    $savant=Object
    $_config=Array
    $_base_href= myservers.correct.url/ATutor

    also member Id gets reported fine?

  • 2006-07-28 08:55:26

    Re: Calendar module gives mysql errors in side menu

    You might want to try turning on debugging, setting the value of AT_DEVEL to "1" near the top of include/vitals.inc.php

    You can then use the debug() functiona to display variable values.

    [php]

    debug($db);

    [/php]

    Also, you could try adding $db to the list of global variables set at the top of the side_menu file.

  • 2006-07-31 08:02:24

    Re: Calendar module gives mysql errors in side menu

    adding $db to the globals list seemed to resolve all the errors, but upon adding an event , I then got a separate error

    Warning: split(): REG_BADRPT in /Library/WebServer/Documents/ATutor/mods/calendar/side_menu.inc.php on line 40

    however the "todays date" shows up as does the link to the calendar event, which works fine see the picture for what I see. I will turn on debudding for a while.

    regards

    Paddy

  • 2006-07-31 08:25:29

    Re: Calendar module gives mysql errors in side menu

    Ok, I am now getting everything looking OK,

    On line 40 of side_menu.inc.php there I believe there is an error in the regular expression associate with the split() function
    I change
    split("*./4, $row2['cal_date']);

    into
    split(".*/4, $row2['cal_date']);

    just the .* has been changed as it was giving the error with split()

    now it all seems fine
    regards

    Paddy