Non-core contributed modules

MUSQL error with MRBS

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: 1.9
  • Component/s: Block: Mrbs
  • Labels:
    None
  • Environment:
    I'm using Apache2Triad distribution and Moodle 1.9.1 on a windows 2003 server.
    PHP 5.1.2
    MYSQL 5.0.18

Description

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.

Activity

Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

Committed patch to add $capacity param check to ensure it is PARAM_INT.

Show
Anthony Borrow added a comment - Committed patch to add $capacity param check to ensure it is PARAM_INT.
Hide
paul rayner added a comment -

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?

Show
paul rayner added a comment - 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?
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
paul rayner added a comment -

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

Show
paul rayner added a comment - 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
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
paul rayner added a comment -

Thanks - that fixed it.
Shane Elliot actually showed me how to fix it during htis mornings keynote at MoodleMoot.

Thanks for all your help.

Show
paul rayner added a comment - Thanks - that fixed it. Shane Elliot actually showed me how to fix it during htis mornings keynote at MoodleMoot. Thanks for all your help.
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: