Skip to content

Git automation is not triggered when editing redirects #37

@jpgorman

Description

@jpgorman

We use statamic's git automation feature to sync changes via the CMS. We've noticed however that changes to the redirects etc don't trigger git commits as expected.

We think it is because the setAll method it the Helpers Data Class doesn't emit an event that can be handled by the addon which would then trigger the git automation:

https://github.com/statamic/cms/blob/3e9f43a81ebf676f7aaf45001a7d3a732585cd84/tests/Git/GitEventTest.php#L123

// src/Helpers/Data.php
use Vendor\YourAddon\Events\YamlFileSaved;
...
setAll () {
 ...
  event(new YamlFileSaved(...);
}
// src/ServiceProvider.php
public function bootAddon() {

  .... 
  Git::listen(YamlFileSaved::class);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions