Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9.5, STABLE backlog
-
Fix Version/s: None
-
Component/s: Database activity module
-
Labels:None
-
Difficulty:Easy
-
Affected Branches:MOODLE_19_STABLE
Description
I noticed when working on another export issue that I was seeing an html entity in the export which a user would not expect to see. This is easily enough fixed by creating an export_text_value function for the text field type (may also need to be done elsewhere - perhaps better to do in /mod/data/lib.php now that I think about it). I'm going to go ahead and replace the return $record->content with html_entity_decode($record->content). I'll attach a patch shortly. Attached are screen shots showing the broken and fixed exports. MDL-19864-whitespace.xls.png shows the text field Location with the html entity of , being displayed where database_export_fixed.png shows it with the html_entity_decode. I tried using the s function as suggested by David in the HQ chat but that did not work because the comma (,) is not considered an htmlspecialcharacter. Peace - Anthony
I began wondering why this has not come up before and realized that the html entities were added to the database because we had done a CVS import of the data exported from the database activity module on a demo site. I suspect that the export had converted the comma to the html entity which was then stored in the database. So this seems to be a case of just not making an assumption about the data in the database and whether it contains or does not contain html entities. Peace - Anthony