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

Remove Media hooks #3994

Closed
aldeed opened this issue Mar 13, 2018 · 0 comments · Fixed by #4013
Closed

Remove Media hooks #3994

aldeed opened this issue Mar 13, 2018 · 0 comments · Fixed by #4013
Assignees
Milestone

Comments

@aldeed
Copy link
Contributor

aldeed commented Mar 13, 2018

Search for MediaRecords.before. in /imports/plugins/core/revisions/server/hooks.js and remove those hooks, but keep the revision control that they implement.

For inserts

The only Media.insert that needs revision control is in /imports/plugins/core/ui/client/containers/mediaGallery.js

Move that insert to a Meteor method, and move the MediaRecords.before.insert logic into that method.

For updates

Make an "updateMediaMetadata" method to replace MediaRecords.before.update.

Needs to be called in one place: /imports/plugins/core/files/server/methods.js in the sortedMediaIDs.forEach

For removes

Make a "removeMedia" method to replace MediaRecords.before.remove.

Call "removeMedia" method instead of Media.remove directly in /imports/plugins/core/ui/client/containers/mediaGallery.js

Should be able to fix #3992 while doing this.

@aldeed aldeed added this to the Release 2.0 milestone Mar 13, 2018
@nnnnat nnnnat self-assigned this Mar 16, 2018
@spencern spencern modified the milestones: Release 1.10, Release 1.11.0 Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants