GithubHelp home page GithubHelp logo

unikent / moodle-local_recyclebin Goto Github PK

View Code? Open in Web Editor NEW
0.0 15.0 3.0 136 KB

Recycle bin for Kent Moodles

License: GNU General Public License v2.0

PHP 87.91% Gherkin 9.78% JavaScript 2.18% CSS 0.12%

moodle-local_recyclebin's People

Contributors

rlorenzo avatar rsivasundaram avatar sk-unikent avatar starrynte avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ccle raad

moodle-local_recyclebin's Issues

Cleanup task fails if course is deleted

When the course cleanup task runs it creates a \local_recyclebin\course and then calls delete_item().

In delete item it creates an event and creates a context_course object. But if a course is deleted, the task will crash and fail.

Here is what we are getting from our command line:

Scheduled task: Clean recycle bin
[RecycleBin] Deleting item 3212...
... used 4 dbqueries
... used 0.015912055969238 seconds
Task failed: Can not find data record in database table course.

Can you put a conditional on the event creation to check if the course exists before firing the event?

Try to get rid of the core hack

Hi Skylar,

I already wrote this on https://moodle.org/plugins/view/local_recyclebin before I realized that you have a Github issue tracker for this plugin. Sorry for the double post.

I think you could improve the necessary core hack by a) throwing a general event in course_delete_module() and catching this event within your plugin instead of notifying your module directly b) creating an issue on tracker.moodle.org to include throwing this event into Moodle core.

How do you think about that?

Thanks,
Alex

Admin settings checkboxes to temporarily disable recycle bin not available

Hi,

I've got a new issue. Directly when updating your plugin, we get those messages:
Warning: in_array() expects parameter 2 to be array, integer given in /var/www/html/moodle_dev/lib/adminlib.php on line 3192

Warning: in_array() expects parameter 2 to be array, integer given in /var/www/html/moodle_dev/lib/adminlib.php on line 3197

Furthermore, comparing your code to the gui, in the code are chechboxes impelemented (enablecourse and enablecategory) that are not displayed in our system (assuming due to this message):
settings

Cheers,
Kathrin

Performance

We don't need the includes all the time, it would help to get rid of this chain:
perfdata

Language string changes in tests/behat/

Due to changes to language strings, some behat tests are failing. Specifically:
String change:
9bddbf5
Should be reflected here:

When I press "Empty recycle bin"

When I press "Empty recycle bin"

String change:
24b14d4#diff-28eeec1136e816b24e581f509a719aefR66
Should be reflected here:

Then I should see "Are you sure you want to delete the selected item in the recycle bin?"

This string should say "Save and continue":

Old task not cleaned up

I are running the latest master on our TEST server and updated our plugins. But when I viewed the scheduled tasks I see this error:

Failed to load task: \local_recyclebin\task\clean_recyclebin
line 255 of /lib/classes/task/manager.php: call to debugging()
line 377 of /lib/classes/task/manager.php: call to core\task\manager::scheduled_task_from_record()
line 121 of /admin/tool/task/scheduledtasks.php: call to core\task\manager::get_all_scheduled_tasks()

It seems that the splitting of the tasks (deb545c) didn't clean up the old task. Is that a core Moodle issue? I am running Moodle 2.7.10.

Capability to empty recycle bins gone with latest version - reason?

Hi,

we're using your plugin and like it very much. Now that you've released a new version, I had a look at the changes and saw that there were some changes to the capabilities.
The capability to empty a recycle bin is gone and I'm wondering what the reasons were for you to changing this?

For my understanding, the possibility to be able to empty a recycle bin should not be withdrawn. So I just wanted to know what your reasons are.

Cheers,
Kathrin

Recycle bin cleanup task is failing

[vagrant@localhost moodle]$ php admin/tool/task/cli/schedule_task.php --execute=\local_recyclebin\task\clean_recyclebin
Scheduled task: Clean recycle bin
[RecycleBin] Deleting item 1...
Stacktrace:

Notice: Undefined property: stdClass::$course in /vagrant/moodle/local/recyclebin/classes/task/clean_recyclebin.php on line 58

Call Stack:
    0.0003     261592   1. {main}() /vagrant/moodle/admin/tool/task/cli/schedule_task.php:0
    0.5692   17385688   2. local_recyclebin\task\clean_recyclebin->execute() /vagrant/moodle/admin/tool/task/cli/schedule_task.php:131

The problem is that following query only returns ID:

$items = $DB->get_recordset_select('local_recyclebin', 'deleted < ?', array($deletefrom), '', 'id');

It should get the full record.

Mdl 2.7, mdl 3.0 - Delete any single item in a recycling bin and the last item gets deleted instead

Regardless of which item you delete in the recycling bin the last item will always be deleted. E.g. if there are 5 items in the bin, and you delete the second item, the bottom gets deleted.

After investigation I think that this is due to a javascript bug. We have found the error in version 1.4 of your plugin, but, as we are upgrading to Moodle 3, I have also downloaded your version 3 plugin and, after looking at the javascript, I can see that the bug hasn't been fixed.

File: module.js
Lines 27 to 38.

The intention is to present a confirmation button to the user and then, assuming a positive confirmation, redirect them back to the index page with the correct parameters for which item to delete in the ULR.

I think the following is happening (I may be wrong??) Unfortunately the url that is being passed to window.location is a combination of ALL href's for all of the links that contain the class of recycle-bin-delete. var = urldelete = this.get('href'); will get all hrefs from this, where, in your code, 'this' is the whole Y space and not the actual link that was clicked. I think changing this.get('href'); to e.get('href') may fix it, but I personally would actually add an extra attribute to the link, e.g. called resourceid and get that from the clicked object rather than rely on the href attribute.

If you add an alert(urldelete); after the variable is initialized then you will see that the variable contains all of the url's from all of the X links (those with the class recycle-bin-delete) concatenated together.

Anyway, at present, the delete functionality of the plugin is unusable.

Mark

One hard-wired English language string in Recycle bin plugin

Hi,

I like your recycle bin plugin for Moodle 2.9 a lot.

I translated the English language strings in AMOS (https://lang.moodle.org/) for the Mexican Spanish language pack and it works beautifully ...
... except that the name itself of the plugin appears in English inside the Administration block and in a few other places. Plese see the attached screen dump and notice correctly translated language strings inside most green rectangles and original hard-wired English text (Recycle bin) inside the upmost rectangle.

I already purged the text language caches.

BTW; I hope you don't mind that I did a Moodle Docs page for this plugin at https://docs.moodle.org/all/es/local/Recycle_bin, so that the documentation for installing this plugin can be very easily translated into several languages (spanish language to be soon).

recycle bin is translated almost all of its strings

Including user data even if user deleting is missing 'moodle/backup:userinfo' capability

On our system we do not allow instructors to backup user data by not allowing the 'moodle/backup:userinfo' capability for their role. We do this to protect user data.

However, a common use case that we want the recycle bin to solve is being able to restore a quiz or assignment that has student submissions if they are accidently deleted.

We cannot figure out a clean way to make this plugin include user data even if they normally cannot do it in the Moodle backup procedure. Got any ideas of how to accomplish that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.