Skip to content

Commit

Permalink
Fixed error when trying to export when no records exist, Fixed menu c…
Browse files Browse the repository at this point in the history
…ontext, Fixed main menu counter not updating
  • Loading branch information
blakej115 committed Oct 22, 2022
1 parent 8f1e4ef commit d22c328
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions controllers/Exports.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Exports extends Controller {

public function __construct() {
parent::__construct();
BackendMenu::setContext('blakejones.magicforms', 'forms', 'exports');
BackendMenu::setContext('BlakeJones.MagicForms', 'forms', 'exports');
}

public function index() {
Expand Down Expand Up @@ -84,7 +84,9 @@ public function csv() {
$filteredRecords = $records->get();
$recordsArray = $filteredRecords->toArray();
$record = $filteredRecords->first();
$headers = array_merge($headers, array_keys($record->form_data_arr));
if (isset($record)) {
$headers = array_merge($headers, array_keys($record->form_data_arr));
}

// ADD HEADERS
$csv->insertOne($headers);
Expand Down
2 changes: 1 addition & 1 deletion controllers/Records.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Records extends Controller {

public function __construct() {
parent::__construct();
BackendMenu::setContext('blakejones.magicforms', 'forms', 'records');
BackendMenu::setContext('BlakeJones.MagicForms', 'forms', 'records');
}

public function view($id) {
Expand Down
4 changes: 4 additions & 0 deletions controllers/records/partials/_list_toolbar.htm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'interval': 3
});
$.oc.sideNav.setCounter('forms/records', data.counter);
$.oc.sideNav.setCounter('forms', data.counter);
$('#Lists').html(data.list['#Lists']);
",
]);
Expand All @@ -35,6 +36,7 @@
'request_success' => "
$('#records-toolbar').find('button').prop('disabled', true);
$.oc.sideNav.setCounter('forms/records', data.counter);
$.oc.sideNav.setCounter('forms', data.counter);
$('#Lists').html(data.list['#Lists']);
",
]);
Expand All @@ -50,6 +52,7 @@
'request_success' => "
$('#records-toolbar').find('button').prop('disabled', true);
$.oc.sideNav.setCounter('forms/records', data.counter);
$.oc.sideNav.setCounter('forms', data.counter);
$('#Lists').html(data.list['#Lists']);
",
]);
Expand All @@ -67,6 +70,7 @@
'request_success' => "
$('#records-toolbar').find('button').blur();
$.oc.sideNav.setCounter('forms/records', data.counter);
$.oc.sideNav.setCounter('forms', data.counter);
$('#Lists').html(data.list['#Lists']);
",
]);
Expand Down
4 changes: 3 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@
1.6.2:
- Fixed getting total count of records preventing install because the records table doesn't exist
1.6.3:
- Fixed needed use Schema for UnreadRecords class
- Fixed needed use Schema for UnreadRecords class
1.6.4:
- Fixed error when trying to export when no records exist, Fixed menu context, Fixed main menu counter not updating

0 comments on commit d22c328

Please sign in to comment.