Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29289

Forum rating restrictions by date breaks ability to rate

    Details

    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Choosing to restrict forum ratings by date causes an error as described in this discussion: http://moodle.org/mod/forum/discuss.php?d=175888. The problem is that the code in mod/forum/lib.php that does the date comparison tries to compare against a non-existent column. This defect was introduced with the fix for MDL-26838.

      The line that reads

      if ($info->timecreated < $info->assesstimestart || $info->timecreated > $info->assesstimefinish) {

      should be changed to

      if ($info->created < $info->assesstimestart || $info->created > $info->assesstimefinish) {

      Searching on "timecreated" will take you directly to the line with the defect.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for sharing a solution to that.

            Show
            salvetore Michael de Raadt added a comment - Thanks for sharing a solution to that.
            Hide
            longfeiyu Longfei Yu added a comment -

            Guys,

            I have a question, why the CREATED time should compare to the ASSESSTIMESTART and ASSESSTIMEFINISH? I think it should be the system current time to compare with both of them. If the current time is out of the START and FINISH range, it should give the message "not available". I just do not understand why the CREATED time (which is fixed when you created the forum) should be used to compare?

            Thanks.

            Show
            longfeiyu Longfei Yu added a comment - Guys, I have a question, why the CREATED time should compare to the ASSESSTIMESTART and ASSESSTIMEFINISH? I think it should be the system current time to compare with both of them. If the current time is out of the START and FINISH range, it should give the message "not available". I just do not understand why the CREATED time (which is fixed when you created the forum) should be used to compare? Thanks.
            Hide
            longfeiyu Longfei Yu added a comment -

            Where is my comment?

            Show
            longfeiyu Longfei Yu added a comment - Where is my comment?
            Hide
            longfeiyu Longfei Yu added a comment -

            Should it be

            if (time() < $info->assesstimestart || time() > $info->assesstimefinish) ?

            Thanks.

            Show
            longfeiyu Longfei Yu added a comment - Should it be if (time() < $info->assesstimestart || time() > $info->assesstimefinish) ? Thanks.
            Hide
            gheredia Gustavo Heredia added a comment -

            I'm agree with Longfei YU

            Show
            gheredia Gustavo Heredia added a comment - I'm agree with Longfei YU
            Hide
            andyjdavis Andrew Davis added a comment -

            I'll do some more investigating and find out when it was fixed (assuming it was) but I don't seem to be able to reproduce this. Its quite possible this has been fixed in the last few months.

            Which dates assesstimestart and finish should be compared to is an interesting question...

            Show
            andyjdavis Andrew Davis added a comment - I'll do some more investigating and find out when it was fixed (assuming it was) but I don't seem to be able to reproduce this. Its quite possible this has been fixed in the last few months. Which dates assesstimestart and finish should be compared to is an interesting question...
            Hide
            andyjdavis Andrew Davis added a comment -

            I haven't been able to identify a specific bug however this has definitely been fixed. The function get_item_time_created() in rating/lib.php handles this problem.

            I have raised MDL-30580 to look at what date we use for the rating date restriction.

            Show
            andyjdavis Andrew Davis added a comment - I haven't been able to identify a specific bug however this has definitely been fixed. The function get_item_time_created() in rating/lib.php handles this problem. I have raised MDL-30580 to look at what date we use for the rating date restriction.

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: