Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When multiple files are uploaded to a single filefield, the template is called multiple times.
This results in multiple lines of each of the three possible sources you have in the template file. While using the template is nice and provides flexibility, you might want to process the files within your preprocess function and simply pass in a $var item.
When a webm is not supplied (which is my use case) you are rendering a path into the source for webm that does not match. The only sources which should be rendered are those which have content.
Comments
Comment #1
mattman CreditAttribution: mattman commentedI've fixed this for myself. It's more of hack and not really how it should be solved, but it's working for me for now.
I created a static in the tpl file (yes, ugly) to account for the multiple calls. Here's the code. Not doing a patch because this doesn't seem like the right solution - it's just temporary.
Do you have your module on github? I could clone and then make pull requests if you want help with the mod.
Comment #2
heshanlk