Details
Description
After upgrade from 1.5.2+ to 1.6.1 and utf8-migration, essays writen before upgrade and therefore migrated do not get show to users (inc. admin). Turning on debug show a message:
Notice: unserialize(): Error at offset 909 of 1110 bytes in /var/www/moodle/mod/lesson/view.php on line 1672.
All pre-migration essays throw that error. New essays seem to work. In the db the attempts look to be fine. Not truncated or anything obvious. Essays are writen in Finnish, so there are a lot of non-ascii characters in them.
Seem fairly obvious that unserialize can handle "useranswer" strings that have gone through utf8-migration. However, the error must be rather subtle, because the "useranswer" strings do seem identical.
Here's the "useranswer" field of lesson_attempt table for the same attempt at the error message above.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
O:8:"stdClass":5:{s:4:"sent";i:1;s:6:"graded";i:1;s:5:"score";i:0;s:6:"answer";s:823:"Ensimmäinen askel kohti sähköistä arkistoa on viitearkisto. Siinä on sähköisessä muodossa vain viitetiedot ja varsinaiset dokumentit ovat paperilla. Tämä soveltuu parhaiten, jos kaikkien tietojen siirto sähköiseen muotoon vaatisi liikaa resursseja. Esim. kirjastojen hakukoneet ovat viitearkistoja.
Sähköinen tekstiarkisto sisältää dokumenttien tekstit sähköisessä muodossa. Kuvat ovat tallennettu erikseen kuvatietokannaksi. tämä sopii silloin, jos arkistoitavasta tiedosta suurin osa on tekstiä. esim. kirjanpidon aineistot ovat näitä tekstiarkistoja.
Sähköinen dokumenttiaineisto perustu kokonaisten dokumenttien käsittelyjärjestelmään. Dokumenttiarkistojen tieto tallennetaan yleensä kuvamuodossa. Tiedonhaku perustuu näytöltä luettavassa muodossa olevaan hakemistoon, joka sisältää jäsentelyn arkiston tiedoista.";s:8:"response";s:130:"Ok, hyvä vastaus!
Lisäksi olisit voinut vielä pohtia kunkin arkistotason soveltumista taloushallinnon aineistojen säilyttämiseen.";}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Issue Links
| This issue blocks: | ||||
| MDL-6854 | Review UTF migration to check everything works properly... |
|
|
|
Doh! Always forgetting details.
That specific issue/error is from https://moodle.tpu.fi/mod/lesson/view.php?id=21198&action=essaygrade&attemptid=83, a page which doesn't have a name, but is the "single essay view", accessible from Grade Essays tab (https://moodle.tpu.fi/mod/lesson/view.php?id=21198&action=essayview). Every essay is unserialized when viewing the Grade Essays tab itself and a couple of dozen error messages are show like this:
Notice: unserialize(): Error at offset 769 of 832 bytes in /var/www/moodle/mod/lesson/view.php on line 1603
In moodle/mod/lesson/view.php both the line 1603 and the line 1672 are:
$essayinfo = unserialize($essay->useranswer);
Default charset for db and table mdl_lesson_attempt is utf8.