diff --git a/blocks/myoverview/db/upgrade.php b/blocks/myoverview/db/upgrade.php index 47160e46847..05870747557 100644 --- a/blocks/myoverview/db/upgrade.php +++ b/blocks/myoverview/db/upgrade.php @@ -142,8 +142,8 @@ function xmldb_block_myoverview_upgrade($oldversion) { )->id; // See if this block already somehow exists, it should not but who knows. - if (!$DB->get_record('block_instances', ['blockname' => 'myoverview', - 'pagetypepattern' => 'my-index', 'subpagepattern' => $subpagepattern])) { + if (!$DB->record_exists('block_instances', ['blockname' => 'myoverview', + 'pagetypepattern' => 'my-index', 'subpagepattern' => $subpagepattern])) { $page = new moodle_page(); $systemcontext = context_system::instance(); $page->set_context($systemcontext); diff --git a/blocks/private_files/tests/behat/block_private_files_dashboard.feature b/blocks/private_files/tests/behat/block_private_files_dashboard.feature index 3b6eb5c2d40..1cb284a9517 100644 --- a/blocks/private_files/tests/behat/block_private_files_dashboard.feature +++ b/blocks/private_files/tests/behat/block_private_files_dashboard.feature @@ -8,6 +8,9 @@ Feature: The private files block allows users to store files privately in moodle Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | private_files | System | 1 | my-index | side-post | And I log in as "teacher1" And "Private files" "block" should exist And I should see "No files available" in the "Private files" "block" diff --git a/blocks/recentlyaccesseditems/tests/behat/block_recentlyaccesseditems_dashboard.feature b/blocks/recentlyaccesseditems/tests/behat/block_recentlyaccesseditems_dashboard.feature index 6af5d32c930..f4e9693f246 100644 --- a/blocks/recentlyaccesseditems/tests/behat/block_recentlyaccesseditems_dashboard.feature +++ b/blocks/recentlyaccesseditems/tests/behat/block_recentlyaccesseditems_dashboard.feature @@ -22,8 +22,6 @@ Feature: The recently accessed items block allows users to easily access their m | idnumber | Test forum name | | name | Test forum name | And I log in as "student1" - And I turn editing mode on - And I add the "Recently accessed items" block Scenario: User has not accessed any item Then I should see "No recent items" in the "Recently accessed items" "block" diff --git a/blocks/tests/behat/configure_block_throughout_site.feature b/blocks/tests/behat/configure_block_throughout_site.feature index fd9c4d91027..449c41298e9 100644 --- a/blocks/tests/behat/configure_block_throughout_site.feature +++ b/blocks/tests/behat/configure_block_throughout_site.feature @@ -51,7 +51,7 @@ Feature: Add and configure blocks throughout the site Scenario: Blocks on the dashboard page can have roles assigned to them Given I log in as "manager1" When I turn editing mode on - Then I should see "Assign roles in Private files block" + Then I should see "Assign roles in Recently accessed items block" Scenario: Blocks on courses can have roles assigned to them Given I log in as "teacher1" diff --git a/lib/blocklib.php b/lib/blocklib.php index 81e84fe4c03..c0635d274dc 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -2686,8 +2686,7 @@ function blocks_add_default_system_blocks() { $page->blocks->add_blocks([ BLOCK_POS_RIGHT => [ - 'private_files', - 'badges', + 'recentlyaccesseditems', ], 'content' => [ 'timeline', diff --git a/my/tests/behat/add_blocks.feature b/my/tests/behat/add_blocks.feature index 8cc75d38382..d00158675cf 100644 --- a/my/tests/behat/add_blocks.feature +++ b/my/tests/behat/add_blocks.feature @@ -23,6 +23,6 @@ Feature: Add blocks to dashboard page And I add the "Latest announcements" block And I turn editing mode off Then I should see "Latest announcements" in the "Latest announcements" "block" - And I should see "Latest badges" in the "Latest badges" "block" + And I should see "Timeline" in the "Timeline" "block" And I should see "Calendar" in the "Calendar" "block" And I should not see "Upcoming events" diff --git a/my/tests/behat/reset_all_pages.feature b/my/tests/behat/reset_all_pages.feature index 21fb4974986..9b909857b95 100644 --- a/my/tests/behat/reset_all_pages.feature +++ b/my/tests/behat/reset_all_pages.feature @@ -45,8 +45,8 @@ Feature: Reset all personalised pages to default And I navigate to "Appearance > Default Dashboard page" in site administration And I turn editing mode on And I add the "Latest announcements" block - And I open the "Latest badges" blocks action menu - And I follow "Delete Latest badges block" + And I open the "Timeline" blocks action menu + And I follow "Delete Timeline block" And I press "Yes" And I turn editing mode off And I log out @@ -54,13 +54,13 @@ Feature: Reset all personalised pages to default And I log in as "student1" And I follow "Dashboard" And I should not see "Latest announcements" - And I should see "Latest badges" + And I should see "Timeline" And I log out And I log in as "student3" And I follow "Dashboard" And I should not see "Latest announcements" - And I should see "Latest badges" + And I should see "Timeline" And I log out And I log in as "admin" @@ -73,13 +73,13 @@ Feature: Reset all personalised pages to default And I follow "Dashboard" Then I should see "Latest announcements" And I should not see "Comments" - And I should not see "Latest badges" + And I should not see "Timeline" And I log out And I log in as "student3" And I follow "Dashboard" And I should see "Latest announcements" - And I should not see "Latest badges" + And I should not see "Timeline" And I log out # Check that this did not affect the customised profiles. diff --git a/my/tests/behat/reset_page.feature b/my/tests/behat/reset_page.feature index 0fe871b91ea..745189e841b 100644 --- a/my/tests/behat/reset_page.feature +++ b/my/tests/behat/reset_page.feature @@ -24,7 +24,7 @@ Feature: Reset dashboard page to default And I add the "Comments" block And I press "Reset page to default" Then I should not see "Latest announcements" - And I should see "Latest badges" + And I should see "Timeline" And I should see "Calendar" And I should not see "Upcoming events" And I should not see "Comments"