By rubinsztajn on
I'm working on a module that transforms user submitted XML into a node. At this point, the module transforms the XML into HTML that is inserted into the module's database table. When the HTML is submitted to the database, it is shortened to ~ 1000 characters. Any thoughts as to why this might be happening?
Here is the relevant part of my .install file:
'finding_aid' => array(
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
'description' => t("Transformed finding aid for display."),
),
And my hook_insert implementation:
function ead_insert($node) {
$file = file_save_upload('ead', $validators);
$node->finding_aid_filepath = $file->filepath;
$node->finding_aid = ead_transform($node->finding_aid_filepath);
db_query("INSERT INTO {ead} (nid, vid, finding_aid, finding_aid_filepath) VALUES (%d, %d, '%s', '%s')",
$node->nid, $node->vid, $node->finding_aid, $node->finding_aid_filepath);
}
If I echo $node->finding_aid I get the full HTML but when I check the entry in the MySQL database, I get the truncated version.
Thanks!
rubinsztajn
Comments
How large are the finding
How large are the finding aids you're trying to work with? I think it's plausible that the finding aids might be way too large for "text" fields in MySQL once they've been transformed into HTML. Also, would you be willing to share this module?