Reaction: Product media deletion does not respect revision control

Created on 13 Mar 2018  路  6Comments  路  Source: reactioncommerce/reaction

Prerequisites

  • [x] Are you running the latest version?
  • [x] Are you able to consistently reproduce the issue?
  • [x] Did you search the issue queue for existing issue? Search issues

Issue Description

With revisions enabled, deleting a product image deletes it permanently and skips the revision control.

Steps to Reproduce

As an admin

  1. Enable revisions
  2. Edit a product and add some images.
  3. Publish
  4. Delete one image but don't publish.

When you view the product as another user, you won't see the deleted image, even though the deletion hasn't yet been published.

Possible Solution

This is a long standing issue, but did not have an issue already. I noticed this when converting away from CollectionFS, but it was not deemed necessary to fix as part of that. The file-collections package that we now use automatically deletes the backing data when you call Media.remove, so we'll need to add some way to skip that, and then some way to manually do it later, upon publication.

Versions

Node: 8.9.1
NPM: 5.7.1
Meteor Node: 8.9.4
Meteor NPM: 5.6.0
Reaction CLI: 0.28.0
Reaction: 1.9.0
Reaction branch: release-1.9.0
Docker: 17.12.0-ce

bug

Most helpful comment

@spencern I just meant, we could work on it using the code in release-1.9.0 as a jumping off point. We don't need to Icebox it.

All 6 comments

@aldeed Can we fix this once the CFS replacement package is merged in? IOW, can we fix it on release-1.9.0?

Given the current size of release-1.9.0 I'd prefer not to block it with a fix for this issue.

@spencern I just meant, we could work on it using the code in release-1.9.0 as a jumping off point. We don't need to Icebox it.

@Akarshit See related #3994. Doing the "remove" hook part of that ticket would probably fix this.

@Akarshit Unassigning you as @spencern and I decided that the core team should handle revision-related issues to avoid overlap.

Fixed by #4035

Was this page helpful?
0 / 5 - 0 ratings