Skip to content

Commit

Permalink
ProjectConfig::EVENT_AFTER_WRITE_YAML_FILES
Browse files Browse the repository at this point in the history
Resolves #14365
  • Loading branch information
brandonkelly committed Feb 14, 2024
1 parent 1ed431e commit 879d638
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Relation fields’ element query params now factor in the element query’s target site(s). ([#14258](https://github.com/craftcms/cms/issues/14258), [#14348](https://github.com/craftcms/cms/issues/14348), [#14304](https://github.com/craftcms/cms/pull/14304))

### Extensibility
- Added `craft\services\ProjectConfig::EVENT_AFTER_WRITE_YAML_FILES`. ([#14365](https://github.com/craftcms/cms/discussions/14365))
- Added `craft\services\Relations::deleteLeftoverRelations()`. ([#13956](https://github.com/craftcms/cms/issues/13956))
- Added `craft\services\Search::shouldCallSearchElements()`. ([#14293](https://github.com/craftcms/cms/issues/14293))

Expand Down
9 changes: 9 additions & 0 deletions src/services/ProjectConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ class ProjectConfig extends Component
*/
public const EVENT_AFTER_APPLY_CHANGES = 'afterApplyChanges';

/**
* @event Event The event that is triggered after the YAML files have been written out.
* @since 4.8.0
*/
public const EVENT_AFTER_WRITE_YAML_FILES = 'afterWriteYamlFiles';

/**
* @event RebuildConfigEvent The event that is triggered when the project config is being rebuilt.
*
Expand Down Expand Up @@ -1627,6 +1633,9 @@ protected function updateYamlFiles(): void
}

Craft::$app->getCache()->delete(self::FILE_ISSUES_CACHE_KEY);

// Let plugins know about it
$this->trigger(self::EVENT_AFTER_WRITE_YAML_FILES);
}

/**
Expand Down

0 comments on commit 879d638

Please sign in to comment.