From a49411b80cde61dae4d7d6086e7bc1ac0c636b72 Mon Sep 17 00:00:00 2001 From: "Shamiso.Jaravaza" <33659194+ssj365@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:15:11 -0600 Subject: [PATCH 1/2] MDL-74749 mod_bigbluebuttonbn: Fix import button --- mod/bigbluebuttonbn/classes/instance.php | 3 +++ mod/bigbluebuttonbn/tests/behat/recordings_import.feature | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/mod/bigbluebuttonbn/classes/instance.php b/mod/bigbluebuttonbn/classes/instance.php index 51efd4d0e1c..0eedca2b56e 100644 --- a/mod/bigbluebuttonbn/classes/instance.php +++ b/mod/bigbluebuttonbn/classes/instance.php @@ -756,6 +756,9 @@ EOF; * @return bool */ public function can_import_recordings(): bool { + if (!config::get('importrecordings_enabled')) { + return false; + } if ($this->can_manage_recordings()) { return true; } diff --git a/mod/bigbluebuttonbn/tests/behat/recordings_import.feature b/mod/bigbluebuttonbn/tests/behat/recordings_import.feature index 045ddc354ca..345140b1a10 100644 --- a/mod/bigbluebuttonbn/tests/behat/recordings_import.feature +++ b/mod/bigbluebuttonbn/tests/behat/recordings_import.feature @@ -110,3 +110,11 @@ Feature: Manage and list recordings And I select "Recordings from deleted activities" from the "sourcecourseid" singleselect And I should see "Recording 1" And I should not see "Recording 2" + + @javascript + Scenario: I check that when I disable Import recording feature the import recording link button should not be shown. + When I log in as "admin" + And the following config values are set as admin: + | bigbluebuttonbn_importrecordings_enabled | 0 | + And I am on the "RoomRecordings1" "bigbluebuttonbn activity" page logged in as "admin" + Then "Import recording links" "button" should not be visible From bd211c77e6e0c5cc0efe4f3902328fd62fcc2bd3 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 7 Sep 2022 06:29:00 +0800 Subject: [PATCH 2/2] MDL-74749 mod_bigbluebuttonbn: Run import button check scenario in nonJS --- .../tests/behat/recordings_import.feature | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mod/bigbluebuttonbn/tests/behat/recordings_import.feature b/mod/bigbluebuttonbn/tests/behat/recordings_import.feature index 345140b1a10..caf5b53f1ff 100644 --- a/mod/bigbluebuttonbn/tests/behat/recordings_import.feature +++ b/mod/bigbluebuttonbn/tests/behat/recordings_import.feature @@ -111,10 +111,9 @@ Feature: Manage and list recordings And I should see "Recording 1" And I should not see "Recording 2" - @javascript - Scenario: I check that when I disable Import recording feature the import recording link button should not be shown. - When I log in as "admin" + Scenario: I check that when I disable Import recording feature the import recording link button should not be shown + Given I log in as "admin" And the following config values are set as admin: | bigbluebuttonbn_importrecordings_enabled | 0 | - And I am on the "RoomRecordings1" "bigbluebuttonbn activity" page logged in as "admin" - Then "Import recording links" "button" should not be visible + When I am on the "RoomRecordings1" "bigbluebuttonbn activity" page logged in as "admin" + Then I should not see "Import recording links"