Moodle 3.1+ Cannot delete resource

Moodle 3.1+ Cannot delete resource

by Ken Russell -
Number of replies: 11

A teacher reported to me that she is unable to delete a simple resource in her course (a PDF). When she tries to delete the file she first gets the standard "Do you really want to delete the file..." but when she clicks Yes, an error pops up that says "Unknown Error." As the admin, I also get the same response when trying to delete the file. Actually, the file at first disappears from the page but when the page is refreshed it is still there.

We recently upgraded to Moodle 3.1+, I'm wondering if this is a bug in this recent version of Moodle.

Any advice you can give me regarding this problem would be greatly appreciated!

Ken
Bellingham School District, WA


Average of ratings: -
In reply to Ken Russell

Re: Moodle 3.1+ Cannot delete resource

by ben reynolds -

Commenting to follow.

What process is the teacher following to delete? Could you spell it out step by step?

In reply to ben reynolds

Re: Moodle 3.1+ Cannot delete resource

by Ken Russell -

She is using the resource item's drop-down menu and choosing "Delete". I used this same method and got the same result. I dont' know of any other way to delete an item.

Attachment moodle3.png
In reply to Ken Russell

Re: Moodle 3.1+ Cannot delete resource

by ben reynolds -

A couple of ideas.

  1. She seems to be deleting from the calendar. that's not where the resource lives. Try going to the classroom and deleting the resource there.
  2. If the resource is used anywhere else, it can't be deleted. So, check other courses, etc.
In reply to ben reynolds

Re: Moodle 3.1+ Cannot delete resource

by Ken Russell -

Ben,

Thanks very much for the suggestions. I know it is not #1, I was unable to delete it (as administrator) and I was not doing that from the calendar but rather from the topic list.

#2 might be a possibility. I took a look at the settings for the file but it does not say that it is being used in any other course. How would I tell if the file was being used in another course? Is there a way to tell?

Thanks again for your help with this!

Ken Russell
Bellingham School District, WA

In reply to Ken Russell

Re: Moodle 3.1+ Cannot delete resource

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Ken,

Another thing you could try is turn on Debugging then try again to delete the resource.

In reply to Helen Foster

Re: Moodle 3.1+ Cannot delete resource

by ben reynolds -

And also, having looked at your other forum post, if the file name has spaces or funny characters, you'll need to rename the file before you can delete it. CamelCaseIsAGoodWayToNameFiles.pptx

In reply to ben reynolds

Re: Moodle 3.1+ Cannot delete resource

by ben reynolds -

Sorry,  I didn't read carefully. She's using the resource's dropdown and clicking delete.

So, I would check to see if it is used anywhere else first.

For security reasons, Moodle's file system is complicated. A resource's link points to a URL that is not the actual location of the file. You'll see "draft" somewhere in the URL. Try comparing the URL before and after deleting. Is it the same?

In reply to ben reynolds

Re: Moodle 3.1+ Cannot delete resource

by ahmed galal -

hi

I've got a problem when delete the Quiz, I was working a database sql server.

When you clear the exam shows this message Unkown error.

Attachment errorr.JPG
In reply to ahmed galal

Re: Moodle 3.1+ Cannot delete resource

by Takeshi Matsuzaki -

Sorry long long distance answer smile 

But if you have the same problem, can you try this one ?

mysql>set innodb_strict_mode=OFF;

In reply to Takeshi Matsuzaki

Re: Moodle 3.1+ Cannot delete resource

by Kim Solis -

I am having the same problem.  I am the administrator and I cannot delete any resource or activities from any of our courses.  I get the "unknown error" message, the resource appears to be deleted and then when the page is refreshed the resource appears again.  I have been hiding the things I don't want anymore, but it is making for a cluttered course.  This has only begun happening recently. We have Moodle 3.1 and have not made any changes.  Will upgrading to Moodle 3.3 help???

In reply to Kim Solis

Re: Moodle 3.1+ Cannot delete resource

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Kim,

I have had the same experience when I had permissions set wrong. I normally do upgrades logged in as root on my Linux Centos 7 server via WinSCP from my Windows 10 desktop. If I change any files I have to remember to reset permissions to any changed Moodle files from root, back to the web server, apache.

Average of ratings: Useful (1)