Please i have serius problems with the chat. te message is
Could not log in to chat room!! |
i dont know what can i do?
thanks
Hello. I have the same problem. Moodle was operating well (1.5). Then I make a new install os Moodle 1.5.1. When I create a Chat, i can´t enter. See the display message
Could not log in to chat room!!
(debug on)
INSERT INTO mdl_chat_users ( ID, CHATID, USERID, GROUPID, VERSION, IP, FIRSTPING, LASTPING, LASTMESSAGEPING, SID, COURSE, LANG ) VALUES ( 11, 11, 2, 0, 'header_js', null, 1121204807, 1121204807, 1121204807, 'BxZnAgsTxetizsjxePeqdXe6psHoKEey', 1, 'pt_br' )
Ooops! I forgot the error message. See bellow:
ERROR: null value in column "ip" violates not-null constraint
INSERT INTO mdl_chat_users ( ID, CHATID, USERID, GROUPID, VERSION, IP, FIRSTPING, LASTPING, LASTMESSAGEPING, SID, COURSE, LANG ) VALUES ( 24, 11, 2, 0, 'header_js', null, 1121268103, 1121268103, 1121268103, 'yFP6teIantN787F7uIGiwaKOIp1G9AaA', 1, 'pt_br' )
Index: lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/chat/lib.php,v
retrieving revision 1.60
diff -u -r1.60 lib.php --- lib.php 24 Apr 2005 19:18:41 -0000 1.60 +++ lib.php 13 Jul 2005 16:46:50 -0000 @@ -381,7 +381,7 @@ global $USER; if (($version != 'sockets') and $chatuser = get_record_select('chat_users', "chatid='$chatid' AND userid='$USER->id' AND groupid='$groupid'")) { $chatuser->version = $version; - $chatuser->ip = $USER->lastIP; + $chatuser->ip = $USER->lastip; $chatuser->lastping = time(); $chatuser->lang = current_language(); @@ -397,7 +397,7 @@ $chatuser->userid = $USER->id; $chatuser->groupid = $groupid; $chatuser->version = $version; - $chatuser->ip = $USER->lastIP; + $chatuser->ip = $USER->lastip; $chatuser->lastping = $chatuser->firstping = $chatuser->lastmessageping = time(); $chatuser->sid = random_string(32); $chatuser->course = $course->id; //caching - needed for current_language too
Thanks very much, skodak! It works!!!
I have made the following tests:
Index: datalib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/datalib.php,v
retrieving revision 1.250.2.2
diff -u -r1.250.2.2 datalib.php --- datalib.php 10 Jul 2005 17:30:32 -0000 1.250.2.2 +++ datalib.php 13 Jul 2005 20:25:24 -0000 @@ -2722,7 +2722,7 @@ echo '<p>Error: Could not insert a new entry to the Moodle log</p>'; // Don't throw an error } if ( isset($USER) && (empty($user) || $user==$USER->id) ) { - $db->Execute('UPDATE '. $CFG->prefix .'user SET lastIP=''. $REMOTE_ADDR .'', lastaccess=''. $timenow .'' + $db->Execute('UPDATE '. $CFG->prefix .'user SET "lastIP"=''. $REMOTE_ADDR .'', lastaccess=''. $timenow .'' WHERE id = ''. $userid .'' '); if ($courseid != SITEID && !empty($courseid)) { // logins etc dont't have a courseid and isteacher will break without it. if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++;};
Thanks Skodak and Martin.
PostGree: PostgreSQL 7.4.2
MySQL: 3.23.58
Martin, with older versions of Moodle all works perfectly. The problems occurs only with my new installation of Moodle (1.5.1).
PostgreSQL 7.4.2 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 3.3.3 20040216 (Red Hat Linux 3.3.3-2.1)
I have also a problem with the Assignment module after this installation. Some strange... see http://moodle.org/mod/forum/discuss.php?d=27513
Thanks everybody.