Skip to content

Commit

Permalink
Fix dashboard widget date range exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Jun 12, 2023
1 parent 5b55002 commit 3271dd3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Campaign

## 2.8.2 - 2023-06-12
### Fixed
Fixed a bug in which Campaign dashboard widgets were throwing exceptions when a date range was set ([#396](https://github.com/putyourlightson/craft-campaign/issues/396)).

## 2.8.1 - 2023-06-08
### Fixed
Fixed a bug in which Feed Me imports were not working when the queue was being run via console requests ([#395](https://github.com/putyourlightson/craft-campaign/issues/395)).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-campaign",
"description": "Send and manage email campaigns, contacts and mailing lists.",
"version": "2.8.1",
"version": "2.8.2",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/campaign",
"license": "proprietary",
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/CampaignStatsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public function getBodyHtml(): ?string
$endDate = Db::prepareDateForDb($endDate);

$campaignQuery->andWhere(['and',
['>=', 'dateCreated', $startDate],
['<', 'dateCreated', $endDate],
['>=', '[[elements.dateCreated]]', $startDate],
['<', '[[elements.dateCreated]]', $endDate],
]);
$sendoutQuery->andWhere(['and',
['>=', 'sendDate', $startDate],
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/MailingListStatsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public function getBodyHtml(): ?string
$endDate = Db::prepareDateForDb($endDate);

$mailingListQuery->andWhere(['and',
['>=', 'dateCreated', $startDate],
['<', 'dateCreated', $endDate],
['>=', '[[elements.dateCreated]]', $startDate],
['<', '[[elements.dateCreated]]', $endDate],
]);
$contactMailingListQuery->andWhere(['and',
['>=', 'subscribed', $startDate],
Expand Down

0 comments on commit 3271dd3

Please sign in to comment.