Skip to content

Commit

Permalink
give a default value to redactor config
Browse files Browse the repository at this point in the history
  • Loading branch information
ryssbowh committed Jan 11, 2022
1 parent b5efd9d commit 49d0731
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Web Puzzlers Emails Changelog

## 1.2.2 - 2022-01-11

### Fixed
- Error when redactor config is not populated
- Redactor config defaults to 'Default.json'

## 1.2.1 - 2022-01-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/behaviors/MessageBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getParsedBody()
return \Craft::$app->elements->parseRefs($this->owner->body);
}

public function redactorInput(string $redactorConfig)
public function redactorInput(?string $redactorConfig)
{
\Craft::$app->view->registerAssetBundle(FieldAsset::class);
RedactorAsset::registerTranslations(\Craft::$app->view);
Expand Down
5 changes: 3 additions & 2 deletions src/helpers/RedactorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ class RedactorHelper
{
/**
* Get redactor settings
*
*
* @param ?string $redactorConfigFile
* @return array
*/
public static function getRedactorSettings(string $redactorConfigFile): array
public static function getRedactorSettings(?string $redactorConfigFile): array
{
$redactorConfig = [];
if ($redactorConfigFile) {
Expand Down
2 changes: 1 addition & 1 deletion src/models/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Email extends Model
public $dateCreated;
public $dateUpdated;
public $template = 'emails/template';
public $redactorConfig;
public $redactorConfig = 'Default.json';
public $system = false;
public $plain = false;
public $bcc;
Expand Down

0 comments on commit 49d0731

Please sign in to comment.