Issue Details (XML | Word | Printable)

Key: MDL-19899
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Dan Marsden
Reporter: Martin Holden
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

SCORM Launch URL's been cut short

Created: 22/Jul/09 12:12 AM   Updated: Friday 03:08 PM
Component/s: SCORM
Affects Version/s: 1.9.5
Fix Version/s: 2.0

Environment: MySQL 5.1., Ubuntu 9.04

Database: MySQL
Participants: Dan Marsden and Martin Holden
Security Level: None
Resolved date: 12/Mar/10
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
I have identified an issue due to the size of the database field used to store the HREF value for a SCORM SCO.

In my test case the launchurl in the IMSMANIFEST.XML for my course was 272 characters, and was getting truncated when Moodle parsed and stored this.

This is due to the field "launch" in mdl_scorm_scoes been defined as varchar(255)

The XSD definitions (imscp_rootv1p1p2.xsd) define that this attribute can be up to 2000 characters:

<xsd:attributeGroup name="attr.href">
<xsd:attribute name="href" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:anyURI">
<xsd:maxLength value="2000"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:attributeGroup>

The fix is to change the table definition to be varchar(2000) if using MySQL 5.03 or later, earlier versions only allow a max field size of 255:

"Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions. The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used. "
Copied from http://dev.mysql.com/doc/refman/5.0/en/char.html

Alternative that may work prior to MySQL 5.03 is to convert field to TEXT but have not tested.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Dan Marsden added a comment - 18/Dec/09 04:04 PM
adding our DB guru to this. - Moodle 2.0 requires mysql 5.0.25 so we can use a varchar 2000 but I'm not sure about our other dbs - Eloy - what type should we change this field to in Moodle 2.0?

thanks!


Dan Marsden added a comment - 26/Feb/10 07:23 AM
caught up with Eloy today - current Moodle db guidelines use a varchar max of 256 - this will change (probably in a 2.x release) to convert all Text(small) to Varchar(4000)

in the meantime we can change to TEXT (small) - I'll commit this to 2.0 sometime soon.


Dan Marsden added a comment - 12/Mar/10 03:08 PM
fix now in HEAD - db changes don't usually go into Stable releases so closing this off. - thanks for the report!