Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content saved events have wrong order #2399

Closed
goellner opened this issue May 15, 2019 · 2 comments

Comments

Projects
None yet
5 participants
@goellner
Copy link

commented May 15, 2019

Describe the bug
The order of the saved events is wrong in core/Data/Content/Content.php.

To Fix

Change

event(new $eventClass($this, $original, $oldPath));
event('content.saved', [$this, $original]); // Deprecated! Please listen on ContentSaved event instead!
event(new ContentSaved($this, $original, $oldPath));

to

event('content.saved', [$this, $original]); // Deprecated! Please listen on ContentSaved event instead!
event(new $eventClass($this, $original, $oldPath));       
 event(new ContentSaved($this, $original, $oldPath));
@jasonvarga

This comment has been minimized.

Copy link
Member

commented May 15, 2019

What does the order affect?

@peda

This comment has been minimized.

Copy link

commented May 15, 2019

@jasonvarga the cache is updated with the content.saved event - so when you are listening for the EntrySaved event the entry can't be found because the cache has not been updated.

When listening for the ContentSaved event the Entry can be found because the cache has already been updated. In my opinion EntrySaved and ContentSaved should behave exactly the same with the only difference being that ContentSaved is triggered for all content items wheras EntrySaved is only triggered for entries.

@jesseleite jesseleite self-assigned this Jun 27, 2019

@jackmcdade jackmcdade closed this Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.