Skip to content

Commit

Permalink
Adjust use of extension in Announcement::__construct()
Browse files Browse the repository at this point in the history
* Expand README.md
  • Loading branch information
Jackson committed Jul 30, 2018
1 parent 501e293 commit 6977e7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ $Announcements.ByType('modal');
```
_Can be 'default', 'modal', 'tray', 'message', 'callout'_

## Limitations

* Does not have any CMS editable functionality

## License

Modified BSD License
Expand All @@ -244,4 +248,6 @@ Read the [license](https://github.com/codecraft/silverstripe-announce/blob/maste
* Create an email Announcement type
* An announcement history for user-focused announcements
* Flag announcement when viewed by user
* Add CMS editable announcements, similiar to [nzta/silverstripe-sitebanner](https://github.com/NZTA/silverstripe-sitebanner)
* Version CMS editable announcements

6 changes: 2 additions & 4 deletions src/Model/Announcement.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@ public function __construct($name, $title = null, $content = null, $heading = nu
}
}

$this->extend('updateDefaultActions', $actions);
$actions = $this->getActions();

foreach ($actions as $action) {
$this->getActions()->push($action);
}
$this->extend('updateDefaultActions', $actions);

parent::__construct();
}
Expand Down

0 comments on commit 6977e7d

Please sign in to comment.