Skip to content

Commit

Permalink
Fix error when no fields are present and CSV view is created
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Aug 24, 2023
1 parent 62f5977 commit 332483a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions view/csv/view_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ public function view_definition_after_gps() {
// Show a list of fields in this view.
$view = $this->_view;
$tags = $view->field_tags();
$tags = implode("<br>", $tags['Fields']['Fields']);
$mform->addElement('static', 'availablefields', get_string('fields', 'datalynx'), $tags);
if (isset($tags['Fields']['Fields']) && !empty($tags['Fields']['Fields'])) {
$tags = implode("<br>", $tags['Fields']['Fields']);
$mform->addElement('static', 'availablefields', get_string('fields', 'datalynx'), $tags);
}
}

/**
Expand Down

0 comments on commit 332483a

Please sign in to comment.