This task was created in response to the bug #1309140: Unable to disable/uninstall.
Drupal core's field module now blocks disabling any module that defines a field type if that field type is still being used in a field instance somewhere. This blocks anyone from disabling this module since some fields get programmatically added during install.
Short term fix in place already:
This is addressed in http://drupalcode.org/project/commerce_file.git/commit/277390f with a temporary fix to set this module's weight heavier than the field module and implementing commerce_file_system_info_alter() to eliminate programmatically controlled fields that will be removed on uninstall of commerce_file.
Long term fix needed:
The commerce_file module needs split into a separate license entity and field module. Then uninstalling the license entity module would remove all field instances allowing the uninstall of the field module.
Comments
Comment #1
recrit commentedComment #2
bojanz commentedCommerce License has been created.
It has been written from scratch and allows for a very wide variety of use cases.
I have just pushed a 7.x-2.x branch of commerce_file that depends on commerce_license (you need 7.x-1.x-dev until I tag an alpha3 / beta1).
I have also created a documentation page at https://drupal.org/node/2043917.
Quoting it:
So, I've dropped the IP Address limit for the reasons listed above. Another module can readd it and then implement hook_commerce_file_can_download().
The number of downloads limit is now global only. It makes sense to me because this limit is mostly about resource conservation and affects all licensed files. I have no problem with implementing the per-file override too, but it wasn't needed for the MVP so I want to see what the initial feedback is like.
A few screenshots:
1) License settings and File settings
2) product edit form
3) Checkout complete.
This works for anonymous checkout too (and the download works too!)
4) admin license listing
5) user's file view. The expiration column is hidden if no licenses expire. The downloads column is hidden if file_download_count is not enabled, or the download limit is not configured. The file is not linked if download limits have been reached (you just get the plain text label).
Comment #3
bojanz commentedThanks to this branch I have closed:
#1945174: file updates
#2021665: storage api integration
#1493646: Anonymous customers cannot purchase downloads
#1939768: Provide file download link after checkout complete
#1976378: Files from another Server
#2013893: firefox displays can't find file error when limit is reached
#1962640: Support IMCE for FileField within the widget
#1186162: allowing commerce_file to use existing media assets
#1198450: Change status to "Expired" when time has elapsed
#1846014: Integrating Commerce File's download limit and the (File) Download Count Module
#1765012: Don't show download link where limits are reached
#1904608: Create fields on hook_flush_caches().
#1244592: Allow file subscriptions
#1412252: Direct file download link
Created a possible-backport tag for issues I think could be fixed in 7.x-1.x based on 7.x-2.x code, if a new 7.x-1.x co-maintainer steps up.
TODO in 7.x-2.x branch:
1) Support for X-Sendfile and X-Accel-Redirect (probably via https://drupal.org/project/nginx_accel_redirect)
2) #1895898: Ensure support for files larger than 2GB
3) Expanding the admin UI (mostly in commerce_license, see #2039725: Investigate ways to expand the admin UI)
I should note that I'm not planning an upgrade path from 7.x-1.x to 7.x-2.x.
Use 7.x-1.x for your existing production sites, and switch to 7.x-2.x for new sites.
Comment #4
brianlp commentedThis looks spot on for a common download site. Awesome.
Do I understand it right that Commerce License is an add-on to Commere File 1.x and will be included in Commerce File 2.x? (Commerce File isn't listed as dependency)
Comment #5
bohemier commentedAwesome bojanz!
This looks very promising... I love the anonymous checkout download function.
thanks for the good work!
Comment #6
bojanz commented@papalapapp
It's the other way around, commerce_file depends on commerce_license (which does most of the work, commerce_file is just a thin wrapper).
Comment #7
bojanz commentedNext steps: #2047035: Reimplement custom download logging, as a part of the effort to support license renewals, and after that is done, testing with Amazon S3.