Commit 83d3f7cb authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use artefact_instance_from_id() to stop turning images into files

parent 68ceb67f
......@@ -455,8 +455,9 @@ class ArtefactTypeBlogPost extends ArtefactType {
$smarty->assign('artefact', $this);
$attachments = $this->get_attached_files();
if ($attachments) {
require_once('artefact.php');
foreach ($attachments as &$attachment) {
$f = new ArtefactTypeFile($attachment->id);
$f = artefact_instance_from_id($attachment->id);
$attachment->content = $f->render(FORMAT_ARTEFACT_LISTSELF, $options);
}
$smarty->assign('attachments', $attachments);
......
......@@ -496,6 +496,10 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
return $data;
}
public static function get_render_list() {
return array(FORMAT_ARTEFACT_LISTSELF, FORMAT_ARTEFACT_RENDERMETADATA);
}
}
class ArtefactTypeFolder extends ArtefactTypeFileBase {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment