Hi,
We have created new plug-in in block called odevmail and did the following steps to insert data in DB
1. Add Form element
$mform->addElement('editor','mail_message_editor',get_string('message','block_odevmail'),null,$editoroptions);
$mform->setType('mail_message_editor', PARAM_RAW);
2. Saved data using following code
$newcategory = new stdClass();
$newcategory->textfield = '';
$data->mail_message_format = 1;
$newcategory = file_postupdate_standard_editor($data, 'mail_message', $editoroptions, $context, 'course', 'mail_message',$newinsert_main);
$DB->set_field('block_odevmail_main','message',$newcategory ->mail_message,array('id'=>$newinsert_main));
Inserted values in all table like block table and mdl_files table against the block
But if we want to display image using following code image is not display
$options = array('noclean' => true, 'overflowdiv' => true);
$context = context_course::instance(1);
$text = file_rewrite_pluginfile_urls($receive_main->message, 'pluginfile.php',$context->id, 'course', 'mail_message', $receive_main->id);
$course_image = format_text($text,1, $options);
Any one having idea,where did go wrong?