-
Bug
-
Resolution: Fixed
-
Minor
-
3.9.9, 3.10.6, 3.11.2
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
MDL-72275-master-2 -
-
0
-
HQ Team International Sprint 7, HQ Team International Sprint 8, HQ Team International Sprint 9, HQ Team International Sprin 10
There are two bugs related to fetching information into the timeline block:
First bug - first loading block with "all" set
When first switching to the "sort by courses" view of the timeline block when "All" time is selected (either manually switching the view, or at load time where the block remembers that is the last view), the block shows no results, even if some actions are required.
Switching the time period to something else (eg 7days), then back to "All" fixes the issue.
This appears to be an issue with the time periods being sent to the core_calendar_get_action_events_by_timesort web service. In the buggy scenarios, the timesortfrom and timesortto params sent are the same timestamp, so the web service does not find anything within that zero second timeframe. Switching away and back to "All" gets around this, because it correctly omits the timesortto value.
The solution here would be to either fix the buggy calls so they don't send a timesortto where relevant, and/or we should update the webservice so that if the timesortto and timesortfrom are equal, we ignore the "to" value.
We should also create a behat test to confirm the fix is working.
Second bug
When switching the ordering (by date or by course), there is an unexpected behaviour where the results shown for each ordering "remember" that ordering's previous timeframe, and revert to it even when the time dropdown has been changed when in the other ordering. For example:
- Block loads ordered by date, with the "all" timeframe. All action events are several months in the future.
- Switch to order by course, set the timeframe to 7 days (which has no results).
- Switch back to order by date, set the timeframe to "6 months" (which has some results).
- Again switch to order by course. The timeframe dropdown will show "6 months", but no events are shown, as the data being fetched is for the "7 days" timeframe, not the expected "6 months timeframe.
The expected behaviour would be that whatever is set in the dropdowns is what is fetched/displayed. The fix for this is to ensure that when switching the order option, the currently selected timeframe is adhered to.
Bonus bug
There is an addition in the mustache template which means that if the "6 months" timeframe is set when the block is first loaded (from the previous time it was opened), that value will be highlighted (in addition to the topmost value), which isn't the case for any other values. Although it seems to me like the "current" value should be the one highlighted and not the top one, there is an existing issue raised for that to be fixed across Moodle, so I will not include any other fix related to that in this issue, it can be looked into after the related issue has been resolved (in case it fixes is in this block also). There were also some difficulties with the order by dropdown breaking when I attempted to apply similar changes, so safest to get the other bug fixes landed and revisit this in more detail later.