Issue Details (XML | Word | Printable)

Key: CONTRIB-736
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Anthony Borrow
Reporter: paul rayner
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Non-core contributed modules

MUSQL error with MRBS

Created: 01/Oct/08 05:58 AM   Updated: 03/Oct/08 10:56 AM
Return to search
Component/s: Block: Mrbs
Affects Version/s: 1.9.1
Fix Version/s: 1.9

Environment:
I'm using Apache2Triad distribution and Moodle 1.9.1 on a windows 2003 server.
PHP 5.1.2
MYSQL 5.0.18

Database: MySQL
URL: http://210.18.232.140/lms/blocks/mrbs/web/edit_area_room.php
Participants: Anthony Borrow and paul rayner
Security Level: None
Resolved date: 01/Oct/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
In trying to edit rooms in MRBS, I get the following error-
Update room failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'computers, room_admin_email='' WHERE id=5' at line 1.

I wanted to add info to the room - examples

Description - Whiteboard/TV
Capacity - 30 Computers
As soon as i hit change, the MYSQL error comes up.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Anthony Borrow added a comment - 01/Oct/08 07:33 AM
Paul - Thanks for reporting this. The issue was that I had not properly checked the $capacity parameter to ensure that it was an integer. I've added the param check so that if you put in 30 computer it will get changed to 30. The capacity field is defined as an integer and thus was not intended to store a string and that is what was causing the error. Peace - Anthony

Anthony Borrow added a comment - 01/Oct/08 07:34 AM
Committed patch to add $capacity param check to ensure it is PARAM_INT.

paul rayner added a comment - 01/Oct/08 12:23 PM
Thanks Andrew
how do I fix this on my system. Downloaded the file above - rev 1.7 (edit_area_room.php) and copied it to the same directory.

Now when I go to edit the room, I get [[editroomarea]] and no further info?

Is there still a glitch, or have I done it incorrectly?


Anthony Borrow added a comment - 01/Oct/08 01:49 PM
Hmmm... I'm not sure why you are getting [[editroomarea]]. That indicates a missing language string. I would just add the line:

$capacity = optional_param('capacity', 0, PARAM_INT);

to your original file. Regardless, you should be able to download the file (check the contents to make sure it looks the same and has the line above in it and that should replace the file on your server. Does that make sense/help?

Peace - Anthony


paul rayner added a comment - 01/Oct/08 03:59 PM
I had an old version of MRBS. Downloaded the latest one, and changed the line indicated in the CVS.

I now get this error - Table 'moodle.mdl_mrbs_area' doesn't exist

I deleted tables for mrbs, and ran through the notification process again.
Checked via phpmyadmin, and it hasn't rebuilt any of the tables.

How can I get the tables to rebuild?
Any ideas?

Cheers


Anthony Borrow added a comment - 01/Oct/08 10:51 PM
Paul - OK, it seems you are in a bit of a pickle. Do you have mrbs data that you want preserved? If not, that is easy. Delete the mrbs tables as you did before and in the site administration block, go to Modules -> Blocks -> Manage blocks and delete the Resource Scheduling (MRBS) block. Then go back to notifications and it should create things from scratch. Essentially, going to notifications checks to see if the block has an entry in the mdl_blocks table. If it does, it does not try to install the block; however, if it does not then it will trigger the install. Let me know if that helps. Peace - Anthony

paul rayner added a comment - 03/Oct/08 10:14 AM
Thanks - that fixed it.
Shane Elliot actually showed me how to fix it during htis mornings keynote at MoodleMoot.

Thanks for all your help.


Anthony Borrow added a comment - 03/Oct/08 10:56 AM
Paul - Glad to hear you got it fixed, are attending a Moot, and got to listen to Shane. That enough to make me jealous Peace - Anthony