• Not Answered

Media File Downloads Not Counted

Enterprise 3.1 / Community 6.1

Just noticed that when displaying the Media Gallery Post page for a specific post that if you click the Download File link in the "Media Gallery - Links" widget that the download is counted. However, clicking on the Download button or the file name link in the "Media Gallery - File" widget will not be counted. The "Links" widget uses the "/postID/download.aspx" URL while the "File" widget provides a direct link to the file, bypassing the download script, which I expect is doing the count recording.

The links in the "File" widget appear to be rendered by the "$core_v2_ui.GetViewHtml" method or the $core_v2_ui.GetPreviewHtml method, which puts the fix out of my hands.

Am I reading the correctly? Is there a fix?

5 Replies

  • Hi Bill,

    Which build of Community 6.1 are you using? For example, 6.1.16.34278.

    I tested on my local setup of version 6.1.16. I believe this is what you are talking about:

    When I click the #2 link, it increments the download count as in your case. When I click the #1 link or button to the left, it also increments the download count. Both links point to the same url for me: http://community6.1.16.34278/all_about_chocolate/m/mediagallery/2/download.aspx

    For my widgets, both of the urls are generated via $core_v2_mediaUrls.DownloadMedia($media.Id)

    Regards,
    Zac Elsik

  • In reply to Zac Elsik:

    Zac,

       I'm on Platform version: 6.1.10.31252, Enterprise 3.1.10.31252. I know we are a bit behind on patches, so there may be something there although I did see anything. Where I am thinking the issue may be coming from is the Document Preview plug-in. But I am not sure about that. In fact I get the same behavior where the file in the gallery cam be previewed or not. 

    The "Download file" link at the top is counted, clicking the image is counted, but clicking the file name below the image will not be counted. Not all files can be clicked on as this image can. So it is really about the link displayed with the file. 

    I am thinking that this widget has changed in a patch or the file preview plug-in changed it. 

    Bill

  • In reply to Bill Corley:

    Hi Bill,

    Thanks for the additional information. I'm having our Product Development team take a look into this one.

    Do you know if your site theme, widgets, or other parts of the site related to this have had any customizations done to them?

    I'm wondering if that link below the image is a link generated by the Doc Preview, which could be working separately and, when clicked, not properly incrementing the download count.

    Zac

  • In reply to Zac Elsik:

    Sorry for the delayed response. Family emergency. I believe this particular widget is the standard coding although it is unclear to me what changes may have been made to it when the document preview plugin was installed.

  • In reply to Bill Corley:

    Hi Bill,

    This appears to be a bug specific to the Enterprise theme.  To fix this, you'll need to modify the Media Gallery - File widget (make sure to edit the Enterprise theme version, not the factory default, it's a drop-down box you have to select from). Around line 77, replace:

    #if ($mediaType != 'Image')
    <a href="$core_v2_encoding.HtmlAttributeEncode($media.File.FileUrl)" class="internal-link download-attachment button">
    <span></span>$core_v2_language.GetResource('MediaGalleries_Button_Download')
    </a>
    #end

    with:

    #if ($mediaType != 'Image')
    <a href="$core_v2_encoding.HtmlAttributeEncode($core_v2_mediaUrls.DownloadMedia($media.Id, false))" class="internal-link download-attachment button">
    <span></span>$core_v2_language.GetResource('MediaGalleries_Button_Download')
    </a>
    #end

    Please let me know if you have any questions.

    Zac

Related