This commit is contained in:
Andrew Nicols
2023-07-13 16:49:59 +02:00
committed by Sara Arjona
2 changed files with 13 additions and 2 deletions
@@ -79,3 +79,14 @@ Feature: An plugin column can be reordered and displayed in the question bank vi
And I click on "Column sort order" "link"
Then I should not see "Currently disabled question bank plugins:"
And I should see "checkboxcustomcolumn"
Scenario: Reordering with disabled columns
When I log in as "admin"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Disable" "link" in the "Question statistics" "table_row"
And I click on "Enable" "link" in the "Question statistics" "table_row"
And I click on "Disable" "link" in the "Question statistics" "table_row"
And I am on the "Course 1" "core_question > course question bank" page
Then I should see "Question bank"
And "Create a new question" "button" should exist
# Really, we are just checking the question bank displayed without errors.
+2 -2
View File
@@ -300,7 +300,7 @@ class view {
}
foreach ($plugincolumnobjects as $columnobject) {
$columnname = $columnobject->get_column_name();
foreach ($corequestionbankcolumns as $key => $corequestionbankcolumn) {
foreach ($corequestionbankcolumns as $corequestionbankcolumn) {
if (!\core\plugininfo\qbank::is_plugin_enabled($componentname)) {
unset($questionbankclasscolumns[$columnname]);
continue;
@@ -334,7 +334,7 @@ class view {
// Mitigate the error in case of any regression.
foreach ($questionbankclasscolumns as $shortname => $questionbankclasscolumn) {
if (empty($questionbankclasscolumn)) {
if (!is_object($questionbankclasscolumn)) {
unset($questionbankclasscolumns[$shortname]);
}
}