Comment 4 for bug 1039865

Revision history for this message
Donna Hrynkiw (donna-hrynkiw) wrote :

We ran into this bug while upgrading from 1.4.0 to 1.6.2. It was a point of significant frustration for us until Yaju responded to our forum posting with a pointer to this page. Many thanks to Yaju for providing such a complete description of both the bug and its fix.

The explicit CAST is now present in *three* locations in the v1.6.2 version of mahara/htdocs/artefact/internal/blocktype/textbox/db/upgrade.php

This were our changes:
# diff upgrade.php-orig upgrade.php
91c91
< SET {block_instance}.configdata = CONCAT('a:1:{s:10:\"artefactid\";i:', CAST({artefact}.id AS CHAR), ';}')
---
> SET {block_instance}.configdata = CONCAT('a:1:{s:10:\"artefactid\";i:', {artefact}.id, ';}')
96c96
< AND CAST({block_instance}.id AS CHAR) = {artefact}.note"
---
> AND {block_instance}.id = {artefact}.note"
106c106
< WHERE b.blocktype = 'textbox' AND a.artefacttype = 'html' AND a.note IS NOT NULL AND CAST(b.id AS $casttype) = a.note",
---
> WHERE b.blocktype = 'textbox' AND a.artefacttype = 'html' AND a.note IS NOT NULL AND b.id = a.note",
#

After this fix, our upgrade was successful.