Skip to content

Commit

Permalink
Fix error on create contact page
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Aug 2, 2022
1 parent 9dabd78 commit b3857f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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.1.3 - 2022-08-02
### Fixed
- Fixed an error that occurred when creating contacts in the control panel.

## 2.1.2 - 2022-07-25
### Fixed
- Fixed a bug when subscribing users via front-end forms.
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.1.2",
"version": "2.1.3",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/campaign",
"license": "proprietary",
Expand Down
6 changes: 4 additions & 2 deletions src/elements/ContactElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ protected static function defineDefaultTableAttributes(string $source): array
*/
public function __toString(): string
{
return $this->email;
return $this->email ?? '';
}

/**
Expand Down Expand Up @@ -747,7 +747,9 @@ public function getHasRoundedThumb(): bool
*/
public function prepareEditScreen(Response $response, string $containerId): void
{
Craft::$app->getView()->registerJs('new Campaign.ContactEdit();');
if (!$this->getIsFresh()) {
Craft::$app->getView()->registerJs('new Campaign.ContactEdit();');
}

/** @var Response|CpScreenResponseBehavior $response */
$response->selectedSubnavItem = 'contacts';
Expand Down

0 comments on commit b3857f9

Please sign in to comment.