Problem/Motivation
Hi there
Thanks for creating this module, I'm finding it really useful so far, but I have one little issue.
I need to update a userfield (last moodle login) on Drupal regularly so I can send some automated emails to students who aren't engaging with the course regularly. I've set it to pull at regular intervals using cron (see attached screenshot), however, it only updates if I visit the profiles of individual students (which I have also set, as you can see in the screenshot). Changing it to only update with cron doesn't make any difference.
Steps to reproduce
Configure the module to pull user fields using cron, as shown in the screenshot
Proposed resolution
If the default is for the cron job to run infrequently, please can you let me know where the settings are so I can adjust it? Alternatively, if it is a bug, can it be fixed?
Thanks in advance for your help
Keiron
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| Selection_348.png | 27.47 KB | keiron |
Issue fork moodle_rest-3322144
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 1.1.x
changes, plain diff MR !6
- 3322144-pulling-user-fields
changes, plain diff MR !2
Comments
Comment #2
ekes commentedSwitching this to a bug report as it's correct that while the setting is there it's not updating users.
Comment #4
ekes commentedOK. I've completely not tested this as I don't have a copy of moodle running at this moment; but if someone could test and confirm I didn't do something daft I can merge this.
If you use git you can follow the MR!2 and get the branch; otherwise the patch is https://git.drupalcode.org/issue/moodle_rest-3322144/-/commit/03f50ef190...
Comment #6
gaddman commentedHi @ekes, I found the code failed if a UID didn't have a valid user (eg if the user was deleted). Also tried to make it more efficient by only processing users who have a Moodle ID. See https://git.drupalcode.org/issue/moodle_rest-3322144/-/commit/737fe3b497....
Comment #8
ekes commentedLooks good. The failing tests are because of upgraded PHPUnit, so they need fixing separately.