mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-72275 timeline: Display "all" time on page load fix
When the timeframe filter was set to "all" when the timeline block was initially loaded, an incorrect value rendered into the template meant the timeframe limit was set to 0 (which will return no results) instead of setting no limit (which would fetch all action events, as intended).
This commit is contained in:
parent
214adb7984
commit
7b5c45f7e0
@ -102,7 +102,7 @@ class main implements renderable, templatable {
|
||||
*/
|
||||
private function get_filter_offsets() {
|
||||
|
||||
$limit = false;
|
||||
$limit = '';
|
||||
if (in_array($this->filter, [BLOCK_TIMELINE_FILTER_BY_NONE, BLOCK_TIMELINE_FILTER_BY_OVERDUE])) {
|
||||
$offset = -14;
|
||||
if ($this->filter == BLOCK_TIMELINE_FILTER_BY_OVERDUE) {
|
||||
@ -170,8 +170,8 @@ class main implements renderable, templatable {
|
||||
'sorttimelinecourses' => $this->order == BLOCK_TIMELINE_SORT_BY_COURSES,
|
||||
'selectedfilter' => $this->filter,
|
||||
'hasdaysoffset' => true,
|
||||
'hasdayslimit' => $offsets['dayslimit'] !== false ,
|
||||
'nodayslimit' => $offsets['dayslimit'] === false ,
|
||||
'hasdayslimit' => $offsets['dayslimit'] !== '' ,
|
||||
'nodayslimit' => $offsets['dayslimit'] === '' ,
|
||||
'limit' => $this->limit
|
||||
];
|
||||
return array_merge($contextvariables, $filters, $offsets);
|
||||
|
@ -77,7 +77,7 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And I click on "Sort by dates" "link" in the "Timeline" "block"
|
||||
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
||||
And I reload the page
|
||||
When I reload the page
|
||||
Then I should see "Course 1" in the "Timeline" "block"
|
||||
And I should see "Course 2" in the "Timeline" "block"
|
||||
And I should see "More courses" in the "Timeline" "block"
|
||||
@ -89,3 +89,25 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And I should not see "Test feedback 2 closes" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 3 closes" in the "Timeline" "block"
|
||||
And I should not see "Test assign 1 is due" in the "Timeline" "block"
|
||||
|
||||
Scenario: Persistent All in course view
|
||||
Given I log in as "student1"
|
||||
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
||||
And I click on "Filter timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "All" "link" in the "Timeline" "block"
|
||||
When I reload the page
|
||||
And I click on "More courses" "button" in the "Timeline" "block"
|
||||
Then I should see "Course 3" in the "Timeline" "block"
|
||||
And I should see "Course 2" in the "Timeline" "block"
|
||||
And I should see "Course 1" in the "Timeline" "block"
|
||||
And I should see "Test choice 1 closes" in the "Timeline" "block"
|
||||
And I should see "Test choice 3 closes" in the "Timeline" "block"
|
||||
And I should see "Test feedback 1 closes" in the "Timeline" "block"
|
||||
And I should see "Test feedback 2 closes" in the "Timeline" "block"
|
||||
And I should see "Test feedback 3 closes" in the "Timeline" "block"
|
||||
And I should see "Test assign 1 is due" in the "Timeline" "block"
|
||||
And I should not see "More courses" in the "Timeline" "block"
|
||||
And I should not see "Course 4" in the "Timeline" "block"
|
||||
And I should not see "Test choice 2 closes" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 4 closes" in the "Timeline" "block"
|
||||
|
Loading…
x
Reference in New Issue
Block a user