<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.