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

CommentFileSizeAuthor
Selection_348.png27.47 KBkeiron
Command icon 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:

Comments

keiron created an issue. See original summary.

ekes’s picture

Category: Support request » Bug report

Switching this to a bug report as it's correct that while the setting is there it's not updating users.

ekes’s picture

Status: Active » Needs review

OK. 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...

gaddman made their first commit to this issue’s fork.

gaddman’s picture

Hi @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....

ekes’s picture

Status: Needs review » Fixed

Looks good. The failing tests are because of upgraded PHPUnit, so they need fixing separately.

  • ekes committed 13158e3b on 1.1.x
    Issue #3322144 by gaddman, ekes: Pulling user fields using cron isn't...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.