mdl_user_info_data "dataformat" field

mdl_user_info_data "dataformat" field

by Blair F. -
Number of replies: 3
Picture of Particularly helpful Moodlers

What, exactly, is the dataformat field for, in the mdl_user_info_data table? I've played around with different settings for the custom user profile fields, and cannot get the values to change, no matter what I do. I've created 4 text fields, three of which show a dataformat of '1' and one shows a value of '0.'

Thanks, in advance!

Average of ratings: -
In reply to Blair F.

Re: mdl_user_info_data "dataformat" field

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If it's text, then it refers to one of these values...

/**
 * Does all sorts of transformations and filtering.
 */
define('FORMAT_MOODLE',   '0');
/**
 * Plain HTML (with some tags stripped).
 */
define('FORMAT_HTML',     '1');
/**
 * Plain text (even tags are printed in full).
 */
define('FORMAT_PLAIN',    '2');
/**
 * Wiki-formatted text.
 * Deprecated: left here just to note that '3' is not used (at the moment)
 * and to catch any latent wiki-like text (which generates an error)
 * @deprecated since 2005!
 */
define('FORMAT_WIKI',     '3');
/**
 * Markdown-formatted text http://daringfireball.net/projects/markdown/
 */
define('FORMAT_MARKDOWN', '4');
In reply to Howard Miller

Re: mdl_user_info_data "dataformat" field

by Blair F. -
Picture of Particularly helpful Moodlers

Thanks for that, Howard! 

In reply to Blair F.

Re: mdl_user_info_data "dataformat" field

by Blair F. -
Picture of Particularly helpful Moodlers

Actually, Howard, I think you're referring to the descriptionformat field of the mdl_user_info_field table. I'm referring to the dataformat field of the mdl_user_info_data table. 

The image shows 3 records from one of my "other fields." Fieldid 6 is a text field. All three records have the same content, "xyz" (for testing purposes), and yet only one of the records has a dataformat of 1. 

The reason this is even coming up is because I'm testing the local_profilecohort and enrol_elediacohortgreeting plugins and the two records with a dataformat of 0 are not being handled as I would expect them to be.

One other thing I'm noticing is that, in the mdl_user_info_data table, all records for fieldid=6 up to id=11619 have a dataformat value of 1 and all records after that gave a dataformat value of 0.  Unfortunately, I don't know what happened at that point to change the dataformat value.

Attachment dataformat.PNG