Hello there,

I have been working in project that sell licensed file using drupal commerce and commerce file field module. Need a formatter mediafront player for commerce file field module and support for commerce product entity where commerce file field in bundled. Since media front player I like most is not capable of this so dig into your code and make a patch that now support all entities not just node but also have a formatter named mediafront player for new commerce file field module.

CommentFileSizeAuthor
commerce.patch4.25 KBer_gaurav_sharma
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

travist’s picture

Status: Patch (to be ported) » Needs work

er_gaurav_sharma,

Thank you so much for this contribution. I can definitely see how this would be needed for a lot of use cases. There were a couple of issues I have with your patch, though... namely...

+++ b/mediafront.moduleundefined
@@ -529,10 +529,11 @@ function mediafront_get_node_field_instance_value($value) {
+    /*if (!empty($value['data'])) {
+      return $value['data']; // Not compatible with commerce_file field module.
     }
-    else if (!empty($value['filename'])) {

Why did you have to comment out this code? I would prefer to add to, and not have to take away from this module, so if it is possible I would like to make this change without having to comment that out. Otherwise, I don't see any reason why we couldn't pull this into this module.

Great stuff!

Travis.

er_gaurav_sharma’s picture

hello Travis,

I have commented out that stuff because commerce_file field module's schema table has own column named 'data'. So it is conflict means you and commerce_file field module you the same key "data" for their purpose. I have no idea what the "data" key do for you. But in case of commerce_file field it holds "file download limit, duration, no of ip address allowed". They are just override each other stuff. So I suggest use another key name in place of "data" key name.

Regards
Gaurav Sharma

Summit’s picture

Status: Needs work » Needs review

Hi, will this please be committed wit the remarks in #2?
Would be great to have commerce possibility on board here!
Greetings, Martijn

travist’s picture

Status: Needs review » Needs work

er_gaurav_sharma,

Will you do a dpm on the $value object so that I can see if there are any parameters within that object that would indicate that this is a commerce object? What I would prefer to do is just add a separate check on that if statement that would ignore it if it comes from commerce.

SocialNicheGuru’s picture

Issue summary: View changes

this is an interesting feature addition.