Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The attached patch updates the module to reflect the change to the use of file entities in Media 2.x. The patch checks for the version number of the enabled media module, and uses the media/[fid] URL if using Media 1.x and file/[fid] is using 2.x.
Comment | File | Size | Author |
---|---|---|---|
#7 | styles-n1414016-7.patch | 878 bytes | DamienMcKenna |
#2 | 1414016-2-media-file-path.patch | 868 bytes | drzraf |
styles_with_media_2-unknown-0.patch | 849 bytes | sdrycroft |
Comments
Comment #1
damontgomery CreditAttribution: damontgomery commentedCross referencing an older and alternative (similar solution) patch.
#1371208: Linked videos point to media/<fid>, which does not exist with media module version 7.x-2.x
I think that the file/[id] solution makes sense to keep functionality, however for youtube links, the file/[id] page is now just a link to the youtube page. Ideally, it would actually be an embedded youtube player. I think it's possible to make a template page to make that happen.
Anyone else know how to style the detailed pages for files?
Update: There are tons of settings for display options here,
/admin/structure/file-types/manage/video/display
Comment #2
drzraf CreditAttribution: drzraf commentedconfirmed since several months (and seems major to me).
updated the patch to call system_get_info when needed, removed trailing whitespaces + handles the -dev verion of the media module (where
$media_info['version']
is NULL)Comment #3
drzraf CreditAttribution: drzraf commentedping
Comment #4
damontgomery CreditAttribution: damontgomery commentedI think one of the issues is that Styles is not recommended with Media 2.x. I've personally stopped using it with Media 2.x, although if you have a site already using it, that may be an issue.
In terms of your patches, I believe their base directories are incorrect and are pointing to folders that are non default Drupal paths for modules anyway.
Create a patch for drupal.org
Apply a patch from drupal.org
Note that you may need to modify the relative and directory paths to match your git usage and file structure a bit.
Thanks for the work and hopefully it works out. I know what it feels like to have a patch go unnoticed.
Comment #5
drzraf CreditAttribution: drzraf commentedThen please, how would I have the "use thumbnail and link image to file in teaser mode" without the Styles module ? (sample use-case)
Even if the filename isn't perfect, the patch has been correctly generated.
The file location is a module's root-based relative path, the patch uses the conventional -p1" path level and should apply cleanly with a simple git apply:
http://drupalcode.org/project/styles.git/blob/refs/heads/7.x-2.x:/contri...
Comment #6
damontgomery CreditAttribution: damontgomery commentedSorry, you were correct and I was confused. Your git patch is right. The styles module seems very oddly organized.
I don't have a simple answer for you in terms of the functionality you're looking for, I just know that the two modules (while they may work) are not recommended, and my understanding is that most people will not use them together. That would suggest that compatibility between the two will not be well maintained.
Please see here for some broad information about using Media 2.x without styles,
http://drupal.org/node/1699054
In this situation, I think you would need to create a template or pre-process for the teaser mode for images (I find templates easier). This template would wrap your file in a link. There is another issue here that you will find that File Entity now puts conditional links inside all it's file chunks and this prevents wrapping these files in that way (such as images). I modified the file_entity.tpl.php to remove these.
It's not an ideal situation, but media in Drupal is not ideal. We found File Entity and Media 2.x to be more suited for our needs, but being newer than the other solution, a lot of common functionality such as the one you described is not there.
I'd love to see a plugin for the new Media 2.x module that mirrors the Media Youtube module. I could see this module as a replacement for the built in Drupal Image Styles and allow simple functionality like linking the image to the original image file, or providing a token based link (for modals). I don't think one exists.
Comment #7
DamienMcKennaA minor tweak to #2 to fix some coding standards violations.