Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-2128

RS when copying a course with a broken reminder rule

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.3
    • Fix Version/s: 10.5.5
    • Component/s: Course
    • Labels:
      None

      Description

      If a reminder rule checks for a group membership but the group is not any more affiliated with the course, the rule is broken and a message is shown when editing the reminder.
      But when copying a course a red screen is shown because of that broken rule. A first approach is to swap the two boolean arguments:

      diff --git a/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java b/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java
      --- a/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java
      +++ b/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java
      @@ -116,7 +116,7 @@
       		if(StringHelper.containsNonWhitespace(configuration)) {
       			ReminderRules rules = toRules(configuration);
       			for(ReminderRule rule:rules.getRules()) {
      -				if(ReminderRuleEngine.DATE_RULE_TYPE.equals(rule.getType()) && rule instanceof ReminderRuleImpl) {
      +				if(rule instanceof ReminderRuleImpl && ReminderRuleEngine.DATE_RULE_TYPE.equals(rule.getType())) {
       					ReminderRuleImpl r = (ReminderRuleImpl)rule;
       					if(DateRuleSPI.AFTER.equals(r.getOperator()) && StringHelper.containsNonWhitespace(r.getRightOperand())) {
       						try {
      

      But I think it would be better to skip the rule when cloning the reminders:

      diff --git a/src/main/java/org/olat/repository/handlers/CourseHandler.java b/src/main/java/org/olat/repository/handlers/CourseHandler.java
      --- a/src/main/java/org/olat/repository/handlers/CourseHandler.java
      +++ b/src/main/java/org/olat/repository/handlers/CourseHandler.java
      @@ -443,7 +443,8 @@
       				RuleSPI ruleSpi = reminderModule.getRuleSPIByType(rule.getType());
       				if(ruleSpi != null) {
       					ReminderRule clonedRule = ruleSpi.clone(rule, envMapper);
      -					clonedRules.getRules().add(clonedRule);
      +					if (clonedRule != null) 
      +						clonedRules.getRules().add(clonedRule);
       				}
       			}
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m