Skip to content

Commit

Permalink
Resolves #1103
Browse files Browse the repository at this point in the history
tbar0970 committed Dec 5, 2024
1 parent 53f0686 commit 51cb841
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions views/view_10_admin__7_import.class.php
Original file line number Diff line number Diff line change
@@ -154,14 +154,14 @@ private function _preparePreview()
case 'existing':
if (empty($_REQUEST['groupid'])) {
add_message(_("You must choose a group first"), 'error');
$this->stage = 'begin';
$this->_stage = 'begin';
return;
}
break;
case 'new':
if (!strlen(array_get($_REQUEST, 'new_group_name'))) {
add_message(_("You must enter a name for the new group"), 'error');
$this->stage = 'begin';
$this->_stage = 'begin';
return;
}
break;
@@ -305,7 +305,11 @@ private function _preparePreview()
continue;
}

$this->_captureErrors($i);
$ei = $i;
$name = array_get($row, 'first_name', '').' '.array_get($row, 'last_name', '');
if (strlen(trim($name))) $ei .= ' ('.$name.')';
$this->_captureErrors($ei);

if (!empty($row['congregation'])) {
$row['congregationid'] = Congregation::findByName($row['congregation']);
}
@@ -431,7 +435,7 @@ private function _preparePreview()
if (!empty($row_errors)) {
$msg = _('Your import file is not valid. Please correct the following errors and try again:').'<ul>';
foreach ($row_errors as $line => $errors) {
$msg .= '<li>Row '.($line+1).': '.implode('; ', $errors).'</li>';
$msg .= '<li>Row '.($line).': '.implode('; ', $errors).'</li>';
}
$msg .= '</ul>';
add_message($msg, 'failure', true);

0 comments on commit 51cb841

Please sign in to comment.