We're using Tridion 2009 SP1 with XSLT templates
A brand new multimedia component (v0.0) and its uploaded binary file
will be correctly published to the preview site at the point it is
first saved (publishing of the binary is done by the
tbbPublishMultimedia
template, shown below).
The multimedia component will enter workflow as minor revision version v0.1 and whilst in workflow (at "Prepare Edition Content Item") the component can be edited and the binary file re-uploaded into the component by the author as required.
Each time the v0.x component is saved in workflow (as v0.1, v0.2, v0.3, v0.4 etc) the latest "in workflow" version of the component and its binary file will be correctly published to the preview site.
Each time the multimedia component is approved for publishing it leaves workflow and becomes a new major version (e.g. v1.0.... or v2.0, v3.0 etc).
If a major version is subsequently edited and re-saved it becomes a new minor revision version (e.g.v1.1) it will then be re-published to the preview site (as will its binary file) and it will then re-enter workflow.
However, while Tridion correctly publishes the latest minor revision version of the actual multimedia component (e.g. v1.1) it seems to publish only the last major version of the binary file it contains (e.g. the v1.0 version). Interestingly, it does appear to publish the latest v1.1 metadata for that binary file (i.e. file type and file size) but not the binary file itself.
In summary, Tridion appears to publish the latest minor/revision "in workflow" version of the binary file if the multimedia component is v0.x but once a major version exists it will only publish the last major version of the binary file (essentially the version prior to it re-entering workflow).
That's what it looks like anyway...
<xsl:template name="tbbPublishMultimedia">
<xsl:if test="string(//tcm:Type)='Multimedia'">
<xsl:variable name="binaryid"
select="string(//tcm:Component/@ID)"/>
<xsl:element name="tcm:MultimediaPublishedFileName">
<xsl:value-of select="tcmse:PublishBinary($binaryid)"/>
</xsl:element>
</xsl:if>
</xsl:template>
Note... in the above template its possible to specify a major version as
the tcmse:PublishBinary parameter
e.g concat($binaryid,"-v2")
to
determine which version to publish, but as it doesn't let you specify a
minor version so that doesn't really help much
I really haven't done much with XSLT templates lately, not sure I can help. Anyway you can confirm is this is only with XSLT or does it happen also with other templates? If it only happens with XSLT then you may be facing a bug, while if it happens to all other languages then it could simply be "by design" and there's not much you can do about it other than opening an Enhancement request.
I found recently that if I ask for version 0 (tcm:1-23-16-v0) of any item Tridion will return the latest version of the item that the current user is allowed to read, including minor versions (in c#). Maybe you can give that a try?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With