Hi everyone. I have set an assessment task for my students in a Moodle 2.0 wiki and we have the bizzarre problem that images uploaded and inserted into posts are dissappearing after several hours.
When a user uploads an image and/or video to the wiki moodle server said image is assigned a location on the server (eg. http://moodle.uni/draftfile.php/8707/user/draft/705008760/activboard300_20090625112013.jpg) such that the image can be displayed in the users post.
After an undefined period of time that asset is no longer linkable and will no longer display in the post. If you put in the address for the asset directly you will get a page with "Sorry, the requested file could not be found" (e.g. The link above).
When you look at a wiki post where this has happened there will be no images in the post and/or a broken image icon (depends on how the browser handles it), but going into edit clearly shows the img tags and references to the missing image.
Please note that a 10min test is unlikely to make this issue apparent as there appears to be some undefined period of time, or unknown trigger before the uploaded assets become dead. Create a wiki post with some uploaded images and leave a day and the issue may become apparent, or maybe there is a trigger such that the more images others upload the quicker your assets are dropped from the server. I can only speculate, but hopefully someone expert in the moodle wiki can resolve.
Please advise ASAP.
I don't know anything about Moodle 2 wiki. That said, I do know a bit about the file API, and draft file URLs should not be used except while you are editing content (such as a wiki page). Once the content has been saved, the version of the image that displays to users when not editing should have 'pluginfile.php' not 'draftfile.php'.
So if, when you use the html editor to add an image to a wiki page, after you save the page, the image on the resulting page still has the URL 'draftfile.php', then imo this is almost certainly a bug in the wiki which (after making sure it still occures in the latest release version, 2.0.2 or whatever) you should report in Moodle Tracker.
I believe the draft file areas, which are (when it's working) used only temporarily while editing, are deleted periodically in cron, which is probably what's causing your problem.
we’re having the same issue.
the same thing happens in the question-db. --> another thread, same issue: http://moodle.org/mod/forum/discuss.php?d=185839
it’s pretty weird. the images dissapear, but i can’t reproduce this.
(same like here: http://tracker.moodle.org/browse/MDL-26782 )
i’ll try 2 reproduce the issue. if i’ll be able, l’ll reopen the bug in the tracker...
i was able 2 reproduce the issue:
the error appears in every section, where u handle images.
the user, which has uploaded the image (this is also the user, which has created the wiki/question/whatever) _can always_ access the picture .
all other users _can not_ access the picture, while its a ‘draftfile.php’ url.
all other users _car_ access the picture, when the url changes to a ‘pluginfile.php’ url.
So the question for me is: When does/should Moodle convert/change the url from ’draftfile.php‘ to ‘pluginfile.php’? I made 3 questions yesterday. one question (only the pictures in there ) has a pluginfile.php url (and there, everything works fine). the othters still has the draftfile.php url. there the pictures just are shown, when u are logged in as the user, which has created the question (und has uploaded the picture).
There might be an issue changing the urls. Do you agree?
I already gave that answer above in this thread. The draftfile.php URLs should be removed as soon as you save an editing form.
For example, if I put an image in this forum post, it will have a draftfile.php URL only while I am editing the forum post. As soon as I hit 'Post to forum' and the actual post contents are saved to the database, there should be no reference any more to draftfile.php.
Maybe I'm in the wrong thread, but I'm experiencing the same problems - and worse - when adding images to questions. Before saving the question, the image shows a link such as:
But after the question is saved, any attempt to display that question will produce an infinite loop that locks up Moodle in the browser. I have to close and clear the browser before Moodle will work in it again. This is a serious problem.
I didn't do the install, my IT team did. They don't speak much English. I don't speak much Chinese. We've had this problem for a couple of months. We're using: $release = '2.1.1+ (Build: 20110803)';
What can we do to fix this?
Ok... I've got a good example on this topic, I think.
I upload a Moodle 1.9 course which I'm intending to convert to 2.x. The headings for each section have an image in them. However, Moodle 2.x now has a "Topic Heading" section. So I go into the topic heading editor and add a topic heading. When I save, my image disappears.
I noticed that it has "draftfile.php" when I edit and also that the image disappears right when I go in to edit. The image is stored in the legacy course files repository for this course due to the conversion but I can't insert it back into the topic easily.
Does this mean that a converted 1.9 course cannot be edited without having this kind of issue?
For me it was enough to disable the filter "Convert URLs into links and images" in: Site Administration> Plugins> FILTERS> MANAGE FILTERS, and the images reappeared. See picture.