My plugin has a template option where you can copy the settings from one plugin instance to another. For some reason I cannot copy the text ($template_get->intro) from the original instance ($template_get). All the other columns are inserted correctly. Even if I statically set the var it wont install, but the text sent from the form will insert. Confused!
$template_get = $DB->get_record('simplefeedback', array('id'=>$simplefeedback->prev));
$tempdata->name = $simplefeedback->name;
$tempdata->section = $simplefeedback->section;
$tempdata->fbtemplate = '0';
$tempdata->introformat = $simplefeedback->introformat;
$tempdata->fbcreatorid = $simplefeedback->fbcreatorid;
$tempdata->course = $simplefeedback->course;
//$simplefeedback->intro enters fine but $template_get->intro is empty even though I can print it.
//$template_get->intro = 'Test text<br><p><br></p>';
if(!empty($simplefeedback->intro)){
$tempdata->intro = $simplefeedback->intro; //this works!
}
else{
$tempdata->intro = $template_get->intro;
}
if($simplefeedback->fbanon > 0){
$tempdata->fbanon = $simplefeedback->fbanon;
}
else{
$tempdata->fbanon = $template_get->fbanon;
}
$status = $DB->insert_record("simplefeedback", $tempdata);