Non-core contributed modules

Update MRBS to install using install.xml in place of the mysql.sql files

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: 2.0
  • Component/s: Block: Mrbs
  • Labels:
    None
  • Environment:
    All
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

In Moodle 2.0 the mysql.sql installer system has been completely removed. As a result the MRBS block fails to create the required tables. We should look at converting MRBS to use an install.xml file to create the required tables.

Activity

Hide
Anthony Borrow added a comment -

Yep - I was thinking of that too. I'll try to get on top of that this week too. Peace - Anthony

Show
Anthony Borrow added a comment - Yep - I was thinking of that too. I'll try to get on top of that this week too. Peace - Anthony
Hide
Anthony Borrow added a comment -

Stephen - Here is a first attempt at creating the install.xml. We will need to change the references to the table names so that they include the Moodle prefix since the install.xml adds that by default. Peace - Anthony

Show
Anthony Borrow added a comment - Stephen - Here is a first attempt at creating the install.xml. We will need to change the references to the table names so that they include the Moodle prefix since the install.xml adds that by default. Peace - Anthony
Hide
Anthony Borrow added a comment -

Ok, so after we create the install.xml we will need to change /blocks/mrbs/web/config.inc.php and change the prefix line to:

$db_tbl_prefix = $CFG->prefix.'mrbs_';

I suspect that at some point it may be better to actually get rid of all the sql stuff in MRBS and begin using Moodle's calls but that will not be any time soon. What made me think of this is that I am using the mysqli driver and had to copy the /blocks/mrbs/web/mysql.php and create a mysqli.php file.

Peace - Anthony

Show
Anthony Borrow added a comment - Ok, so after we create the install.xml we will need to change /blocks/mrbs/web/config.inc.php and change the prefix line to: $db_tbl_prefix = $CFG->prefix.'mrbs_'; I suspect that at some point it may be better to actually get rid of all the sql stuff in MRBS and begin using Moodle's calls but that will not be any time soon. What made me think of this is that I am using the mysqli driver and had to copy the /blocks/mrbs/web/mysql.php and create a mysqli.php file. Peace - Anthony
Hide
Anthony Borrow added a comment -

Stephen created /blocks/mrbs/db/install.xml file, added mysqli.php file, and modified config.inc.php file to use tables created by install.xml file. I have committed these changes to HEAD would you be able to test and make sure everything still works. Thanks - Anthony

Show
Anthony Borrow added a comment - Stephen created /blocks/mrbs/db/install.xml file, added mysqli.php file, and modified config.inc.php file to use tables created by install.xml file. I have committed these changes to HEAD would you be able to test and make sure everything still works. Thanks - Anthony
Hide
Anthony Borrow added a comment -

The fields named timestamp were the ones that caused me the most grief as they had a default value which I have replaced with 0. I think ultimately these should be INT(10) fields like everything else in Moodle; however, I was not inclined to look into at the moment. If you get a chance to look into it to see how this impacts the actual usage. I'm not sure if those fields are really even used as its been so long since I've looked at the code. Peace - Anthony

Show
Anthony Borrow added a comment - The fields named timestamp were the ones that caused me the most grief as they had a default value which I have replaced with 0. I think ultimately these should be INT(10) fields like everything else in Moodle; however, I was not inclined to look into at the moment. If you get a chance to look into it to see how this impacts the actual usage. I'm not sure if those fields are really even used as its been so long since I've looked at the code. Peace - Anthony
Hide
Anthony Borrow added a comment -

Stephen - OK, I switched the type of the timestamp field in the entry and repeat tables to be an int(10) and modified some of the MRBS code to make use of that. I did some preliminary testing but more testing would not be a bad idea. In any case, test what is in HEAD and let me know if you discover any problems. Peace - Anthony

Show
Anthony Borrow added a comment - Stephen - OK, I switched the type of the timestamp field in the entry and repeat tables to be an int(10) and modified some of the MRBS code to make use of that. I did some preliminary testing but more testing would not be a bad idea. In any case, test what is in HEAD and let me know if you discover any problems. 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: