Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported events are excluded from notifications #143

Open
thebenkahn opened this issue Nov 4, 2021 · 1 comment
Open

Imported events are excluded from notifications #143

thebenkahn opened this issue Nov 4, 2021 · 1 comment
Assignees

Comments

@thebenkahn
Copy link

thebenkahn commented Nov 4, 2021

Describe the bug (required)
When you use an external calendar and import events, the Reminders plugin skips notifications for the event if no module types are exluded. In the cron logs I am seeing that the event is skipped because the module type ' ' is excluded. And in the database I can see that imported events have the field 'modulename' null, while manually created user/site events have that value set to 0.

If I set an excluded activity in the plugin settings, E.G. 'workshop' that seems to workaround the issue.

My thought is that the blank DB entry for mdl_event.modulename is being compared to the default empty string for excluded modules and matching.

To Reproduce (required)
Steps to reproduce the behavior:

  1. Import a calendar event from an external source (google cal, etc)
    as a user event
  2. Manually create a user event at the same time
  3. Configure plugin to remind for user events
  4. Observe that the manual event gets a reminder and the imported event does not

Expected behavior (required)

  1. Imported events should have the same behavior as manually created events.

Cron Logs (required)

testing with a user level event, #380 is external event and #381 is manually created on the test site

 [Local Reminder] Time window: Wednesday, November 3, 2021, 6:48 PM to Wednesday, November 3, 2021, 7:00 PM
   [Local Reminder] Found 2 upcoming events. Continuing...
  [Local Reminder] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  [Local Reminder]   Skipping event #380 in excluded module ''!
  [Local Reminder] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   [Local Reminder] Processing event in ahead of 0.0034722222222222 days.
   [Local Reminder] Processing event#381 [Type: user, inaheadof=0.0034722222222222 days]...
   [Local Reminder] A reminder can be sent for event#381 , detected through custom schedule.
  [Local Reminder] Starting sending reminders for 381 [type: user, mod: 0]

Environment (required):

  • Moodle version: 3.10.5
  • Database: mariadb
  • PHP Version: 7.3.28.1.16.04.1.1
  • Plugin version 2.4 2021062000
@isuru89
Copy link
Owner

isuru89 commented Mar 6, 2022

@thebenkahn
The plugin cannot continue when the event's modulename is empty if the event type is set to due. The above error message come when trying to send an overdue reminder.

However, course and modulename are mandatory to find out relevant users to send this activity reminder. Without these context information, the plugin cannot proceed.

See here:

if (isemptystring($event->modulename)) {

And also here:
function send_overdue_activity_reminders($curtime, $timewindowstart, $activityroleids, $fromuser) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants