cannod / moodle-drupalservices

Moodle plugin to connect to Drupal services
36 stars 25 forks source link

Help with sync users cron job, modifying a little? #68

Open goose2000 opened 8 years ago

goose2000 commented 8 years ago

Hi, thought I might not need the sync feature, but think I do now, cause I got to get users moved over first, so they exist, so they can be enrolled into courses.

I setup the config part in the moodle site with my 'remote' user. All went fine. Did an experiment with debugging on, and it failed no doubt because I have user_revision disabled right now.

Can I modify this so it's not reliant on the user_revision module ? FWIW, here is my debug info, I think it logged in okay, just puked trying to reach the 'vid' I think.

Any ideas on modifying this so it only uses the Drupal user table to sync from?

Server Time: Mon, 30 Nov 2015 16:15:52 -0500

Execute scheduled task: Legacy cron processing for plugins ... started 16:15:52. Current memory use 10.6MB. Running auth crons if required... Running cron for auth/drupalservices... ++ attempting to reach service url: http://ssww.unc.edu/sswevents/index.php?q=/moodlesso/user/token ++

Notice: Undefined property: stdClass::$pagesize in D:\inetpub\wwwroot\drupal_ssw_events\lms\auth\drupalservices\auth.php on line 286 ++ attempting to reach service url: http://ssww.unc.edu/sswevents/index.php?q=/moodlesso/user?vid=0,page=0,pagesize= ++

Fatal error: Uncaught exception 'coding_exception' with message 'Coding error detected, it must be fixed by a programmer: A lock was created but not released at: D:\inetpub\wwwroot\drupal_ssw_events\lms\lib\classes\task\manager.php on line 460

Code should look like:

$factory = \core\lock\lock_config::get_lock_factory('type'); $lock = $factory->get_lock(Resource id #502); $lock->release(); // Locks must ALWAYS be released like this.

' in D:\inetpub\wwwroot\drupal_ssw_events\lms\lib\classes\lock\lock.php:117 Stack trace:

0 [internal function]: core\lock\lock->__destruct()

1 {main}

thrown in D:\inetpub\wwwroot\drupal_ssw_events\lms\lib\classes\lock\lock.php on line 117