Hello there,

I test a Drupal store with Drupal Commerce, Commerce File and PayPal WPS sandbox accounts. It works properly so I would like to thanks all of you for your contributions.

I am glad to see that since the latest release (Commerce File 1 Beta 3) I can manage the licenses manually.
However I found a small issue during playing with it. Please look after it and give me a tip, if you can, how to solve this problem. Thanks!

The story:

  1. In the demo store there are digital products with downloadable ZIP file extension (only zip files). The configuration is the following: Store -> Products -> Product types -> Managed fields -> Commerce file -> Edit -> Allowed file extensions -> ZIP (only this one). It works.
  2. The store and the checkout works seamlessly (it's great).
  3. Since the Commerce File could not manage the version control of digital products yet, I would like to add file licenses to my buyers manually like "product-1.0.zip" and "product-1.1.zip" etc.
  4. When I go to Administrator -> Store -> File licenses -> Add a file license -> Licensed file upload, the system does not allow me to choose ZIP file extension but only the default files with the following extensions: mp4, m4v, flv, wmv, mp3, wav, jpg, jpeg, png, pdf, doc, docx, ppt, pptx, xls, xlsx. However I configured the product type allowing to handle ONLY ZIP file extension and not other extension.

Is this issue a bug and how can I solve it? Thanks for your advice!

Best Regards,
Robert

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

recrit’s picture

Category: support » bug

this is definitely a bug. The field on the license entity is programmatically added as locked. Similar to price on a product, a license needs a commerce file field so it cannot be open to some admin removing it. That said, this has been uncovered previously in regards to file scheme on that field (see #1239304: License File Field should be scheme independent); however this is the first regarding the allowed extensions so we can leave it open and not mark as duplicate.

The issue with locked fields is that even if I open up the type config page for the license type, you still would not be able to change the settings. The argument to make it allow any file scheme or any extension (currently not implemented) is that the files get propagated through checkout via a line item field and then to the license after checkout completed. In that process, the field settings on the license actually dont matter since the fid is the same as it is through all phases... and the original uploaded file on the product determines the scheme, extension, etc.

The problem occurs on the manually created license.
Quick Fix - I could make the license field allow any extension. This would allow you to create them with zip, but not ideal if you want to restrict admins that would be creating.

Long Term fix - I need to think of a better way to handle it

recrit’s picture

Title: Unable to upload a file license manually (ZIP extension) » License file field allowed extensions should not be a default list
Priority: Normal » Major
hmartens’s picture

Good day

Is there anyway that I can get around this? I need to be able to upload all kinds of formats and I'm the only admin on the store. I can't get to the place where I change the upload formats because it is 'locked'...

Please help :)

Intercisa’s picture

Hello There,

I would be appreciate so much if recrit or other smart module developer would be kind to fix this issue and do not restrict the file formats in Commerce File. What do you think, is there any solution for it in the near future? Thank you!

Best regards,
Robert

hmartens’s picture

Can ANYONE please give us a temporary work around even if we have to hack the module files ourselves? It's quite an important function this and we can't use it if it can't atleast accept a zip file...

Please help!

hmartens’s picture

Has anyone come across a work-around on this yet?

recrit’s picture

Status: Active » Needs review

I've committed a fix to allow editing of the Commerce File field settings on the license entity while blocking the field from being deleted.
http://drupalcode.org/project/commerce_file.git/commit/75045cd

hmartens’s picture

Thank you so much recrit!

I really appreciate all your hard work. Thanks. One day when we're at the same Drupalcon I'll buy you a couple of beers ;)

recrit’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.