Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.9.2
-
Fix Version/s: None
-
Component/s: Module: OU wiki
-
Labels:None
-
Environment:mysql 5.0.22 php 5.1.4 Windows server OUWiki 2008100600 downloaded 28/1/2009
-
Database:MySQL
-
Affected Branches:MOODLE_19_STABLE
Description
If you copy and past entries from Word into the OUWiki, you get an error:
Database problem: Data too long for column 'xhtml' at row 1 (code OUWIKI-E:\Websites\...oursite...\root\moodle183\mod\ouwiki\ouwiki.php/1614)
It appears to be generated because of the additional markup from Word text, as the actual entries are not excessively long. The workaround we are currently using is to ask students to use the Word Cleanup button or use text mode for editing, but this seems beyond the capability of some of our students.
(The error occurs at the point where it inserts a record for the new version, obviously.)
This is very odd. I checked in my MySQL test installation and the xhtml field has type 'longtext'. According to the MySQL manual, this type should be able to store up to 4 gigabytes:
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
This would also be limited by the max_allowed_packet value, but this defaults to 16MB:
http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html#option_mysql_max_allowed_packet
Word stores enough crap in the file that it is typically multiplied by a factor of five or ten over the plain HTML equivalent (which by the way does cause reduced performance), but for any reasonable document, that would still be much less than 16MB.
The only thing I can think about to debugging is if you can reproduce the problem, maybe add some code just before line 1614 mentioned that does
print_object(strlen($version->xhtml)); exit;
so you can see how many bytes it's trying to insert. If the number of bytes is some reasonable number, like less than 1000000, then there's a database/configuration problem. If it's an unreasonable number, then maybe there is a weird problem in ouwiki.
If it's a database issue, unfortunately I don't know anything much about MySQL - maybe you can find an expert (or ask in forums etc) who'd know why this error would occur even when trying to put a relatively small bit of data into the field.
You might like to attach a Word document that causes this problem when you do Ctrl-A to select all in Word, Copy, and Paste into ouwiki's html editor, to see if it can be reproduced elsewhere.