Skip to content

Commit

Permalink
Fixed import error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Croker committed May 16, 2020
1 parent 249905a commit 4983681
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
### Changed
- Improved log messages of failed sendouts ([#138](https://github.com/putyourlightson/craft-campaign/issues/138)).

### Changed
- Improved the error message when trying to import a CSV file without selecting a mailing list ([#141](https://github.com/putyourlightson/craft-campaign/issues/141)).

## 1.15.3 - 2020-05-12
### Fixed
- Fixed a bug in the Amazon SES webhook for bounce and complaint notifications ([#103](https://github.com/putyourlightson/craft-campaign/issues/103)).
Expand Down
14 changes: 8 additions & 6 deletions src/controllers/ImportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ public function actionDeleteImport(): Response
* Returns the fields template
*
* @param ImportModel $import
* @param array $mailingListIds
* @param array|string|null $mailingListIds
*
* @return Response
* @throws InvalidConfigException
*/
private function _returnFieldsTemplate(ImportModel $import, array $mailingListIds = []): Response
private function _returnFieldsTemplate(ImportModel $import, $mailingListIds): Response
{
$variables = [];
$variables['import'] = $import;
Expand All @@ -337,11 +337,13 @@ private function _returnFieldsTemplate(ImportModel $import, array $mailingListId
// Get mailing lists
$variables['mailingLists'] = [];

foreach ($mailingListIds as $mailingListId) {
$mailingList = Campaign::$plugin->mailingLists->getMailingListById($mailingListId);
if (is_array($mailingListIds)) {
foreach ($mailingListIds as $mailingListId) {
$mailingList = Campaign::$plugin->mailingLists->getMailingListById($mailingListId);

if ($mailingList !== null) {
$variables['mailingLists'][] = $mailingList;
if ($mailingList !== null) {
$variables['mailingLists'][] = $mailingList;
}
}
}

Expand Down

0 comments on commit 4983681

Please sign in to comment.