• Resolved magland

    (@magland)


    There appears to be a major issue with plugin.

    When adding a new download to the system, under the downloadable files/ versions box it is pre-populated with ALL downloads currently in the system.

    The download count of recently added downloads is showing the total of all downloads in the system.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey @magland,

    Thanks for reaching out to us.

    Which version of our plugin are you using?

    Thread Starter magland

    (@magland)

    It was 4.4.4 but i’ve tried 4.4.2 and 4.2.0 and it remains the same.

    Thread Starter magland

    (@magland)

                <div class="dlm-metaboxes downloadable_files">
    				<?php
    				$i        = - 1;
    				$versions = $download->get_versions();
    
    				if ( $versions ) {
    
    					/** @var DLM_Download_Version $version */
    					foreach ( $versions as $version ) {
    
    						$i ++;
    
    						download_monitor()->service( 'view_manager' )->display( 'meta-box/version', array(
    							'version_increment'   => $i,
    							'file_id'             => $version->get_id(),
    							'file_version'        => $version->get_version(),
    							'file_post_date'      => $version->get_date(),
    							'file_download_count' => $version->get_download_count(),
    							'file_urls'           => $version->get_mirrors(),
    							'version'             => $version,
    						) );
    
    					}
    				}
    				?>
                </div>

    The problem seems to be with this code in src/Admin/WritePanels.php

    When editing an existing download it works fine, when adding a new download the line of code ‘$versions = $download->get_versions();’ is an array of ALL downloads currently in the system. This means every time a d=new download is added all versions of all other files are added automatically.

    The function get_versions is flawed somewhere, possibly in get_version_ids but I can’t quite pick it apart.

    This makes the plugin unusable at the moment.

    Hey @magland,

    Can you please confirm if the issue you are facing is with the total download count calculating downloads of all versions in that particular download? If that is the case, then please note that this is how the plugin is setup. You can reset the count manually.

    Thread Starter magland

    (@magland)

    Not sure why this post is marked as resolved….

    The issue is not to do with the count.

    When you go to the add new download screen under the files/versions box (which should be empty because it’s a new download being added) it lists all other downloads in the system as versions of the new download.

    It is not restricted to only listing versions of that file it is showing ALL other files when adding a new download.

    Does that make sense?

    If I have temporarily fixed it by adding a true / false flag within that function to check if the file being added is new or not. If it is then it should not list any files in the files/versions box.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error with files/versions and download count’ is closed to new replies.