Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Product
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2016 at 02:47 UTC
Updated:
13 Nov 2021 at 06:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mglamanOr implement the methods required so we can re-use Entity API's helper functions: http://drupal.stackexchange.com/a/188724/13179
Comment #3
mglamanComment #4
candelas commentedYes, my table with revisions is growing and we don't use those revisions for anything :)
Comment #5
DrupalWoody commentedWhere do you put this code to get it to run?
I tried to use the Field SQL Norevisions module on a test copy of my database, and it cleared out 4 GB of revisions, but didn't touch any of my commerce product entities, so there's still 12 GB of revisions left.
Comment #6
potop commentedImplemented this functionality in a module: Commerce Product Revision Delete Using the code provided by Matt Glaman in the answer here.
Comment #7
rszrama commentedFollowing the pattern of #2442049: Commerce order revision deletion callback, I implemented the
EntityAPIContollerRevisionableInterfacein the product controller, added acommerce_product_is_latest_revision()function similar to the one for orders, and documented the revision delete hook incommerce_product.api.php.Comment #8
rszrama commentedWith this interface implemented, you delete a product revision by calling
entity_revision_delete('commerce_product', ##), and it will prevent you from deleting the current revision.Comment #9
rszrama commentedCommitted.