delete_instance not called on deleting a resource

Αυτή η ανάρτηση στο φόρουμ έχει καταργηθεί

Αριθμός απαντήσεων: 10
Το περιεχόμενο αυτής της ανάρτησης στο φόρουμ έχει καταργηθεί και δεν είναι πλέον δυνατή η πρόσβαση.
Σε απάντηση σε Διαγραμμένος χρήστης

Αυτή η ανάρτηση στο φόρουμ έχει καταργηθεί

Το περιεχόμενο αυτής της ανάρτησης στο φόρουμ έχει καταργηθεί και δεν είναι πλέον δυνατή η πρόσβαση.
Σε απάντηση σε Διαγραμμένος χρήστης

Re: delete_instance not called on deleting a resource

από Patrick Guillou -

Hi !

I've got the same problem... mymodule_delete_instance is implemented in lib.php if I rename it I have an error (same thing as you describe)... The module instance is removed from the course but the module itself is not removed from it's DB table... Did you find any solution / workaround ?

Moodle version 3.3.2+ (Build: 20171013)

Σε απάντηση σε Patrick Guillou

Αυτή η ανάρτηση στο φόρουμ έχει καταργηθεί

Το περιεχόμενο αυτής της ανάρτησης στο φόρουμ έχει καταργηθεί και δεν είναι πλέον δυνατή η πρόσβαση.
Σε απάντηση σε Διαγραμμένος χρήστης

Re: delete_instance not called on deleting a resource

από Davo Smith -
Φωτογραφία Core developers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers

Have you tried using Xdebug and putting a breakpoint in your function to see if it is being hit?

If that doesn't help, try searching for the place an error is thrown if you don't define the required function and see if you can trace up from there to work out why it isn't being called.

It would also be helpful if you have created a tracker ticket for this to post the ticket link in the forum, so anyone interested can find it without searching.

As an aside, I've written several activity plugins and the instance_delete functions for them were all working the last time I checked - but I don't regularly investigate, so it's always possible (although unlikely?) that this has been broken in recent versions of Moodle.


Σε απάντηση σε Davo Smith

Αυτή η ανάρτηση στο φόρουμ έχει καταργηθεί

Το περιεχόμενο αυτής της ανάρτησης στο φόρουμ έχει καταργηθεί και δεν είναι πλέον δυνατή η πρόσβαση.
Σε απάντηση σε Διαγραμμένος χρήστης

Re: delete_instance not called on deleting a resource

από Davo Smith -
Φωτογραφία Core developers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers

If you've created a ticket, please copy + paste the ticket URL here, so other users can see it and comment on it.

Σε απάντηση σε Davo Smith

Re: delete_instance not called on deleting a resource

από Davo Smith -
Φωτογραφία Core developers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers

OK - this is a new one for me. It looks like course module deletion is now handed off to an ad-hoc background task if the recycle bin is enabled (as it will need to do a backup of the activity, before it completes the deletion process).

That means that if you want to see the deletion complete, you need to run the Moodle cron script (or disable the recycle bin feature).



Σε απάντηση σε Davo Smith

Αυτή η ανάρτηση στο φόρουμ έχει καταργηθεί

Το περιεχόμενο αυτής της ανάρτησης στο φόρουμ έχει καταργηθεί και δεν είναι πλέον δυνατή η πρόσβαση.
Σε απάντηση σε Διαγραμμένος χρήστης

Re: delete_instance not called on deleting a resource

από Darko Miletić -

You have two options:

  1. Disable Recycle bin for courses.
  2. Live with it.

The way async deletion is implemented does not give you any notification that your activity is queued for deletion. You will need to manually check course_modules.deletioninprogress field for any of your activities to actually know.



Σε απάντηση σε Darko Miletić

Αυτή η ανάρτηση στο φόρουμ έχει καταργηθεί

Το περιεχόμενο αυτής της ανάρτησης στο φόρουμ έχει καταργηθεί και δεν είναι πλέον δυνατή η πρόσβαση.