Hi, I don’t know if is a problem of my setup but can’t download files defined as public.
I found a workaround:
just add a line to src/MediaLibrary/MediaAccessControl.php
Current Code:
function protectMediaLibrary(){
if(isset($_REQUEST['wpdmmediaid'])){
global $wpdb;
$current_user = wp_get_current_user();
$ID = wpdm_query_var('wpdmmediaid', 'int');
$media = get_post($ID);
if(!$media) Messages::fullPage('404', esc_attr__( 'Media not found!', WPDM_TEXT_DOMAIN ));
$media_meta = wp_get_attachment_metadata($ID);
//wpdmdd($media_meta);
//wpdmdd($media);
$media->path = str_replace(home_url('/'), ABSPATH.'/', $media->guid);
$media->filesize = wpdm_file_size($media->path);
$access = get_post_meta($media->ID, '__wpdm_media_access', true);
$password = get_post_meta($media->ID, '__wpdm_media_pass', true);
...
My patch
function protectMediaLibrary(){
if(isset($_REQUEST['wpdmmediaid'])){
global $wpdb;
$current_user = wp_get_current_user();
$ID = wpdm_query_var('wpdmmediaid', 'int');
$media = get_post($ID);
if(!$media) Messages::fullPage('404', esc_attr__( 'Media not found!', WPDM_TEXT_DOMAIN ));
$media_meta = wp_get_attachment_metadata($ID);
//wpdmdd($media_meta);
//wpdmdd($media);
$media->path = str_replace(home_url('/'), ABSPATH.'/', $media->guid);
$media->filesize = wpdm_file_size($media->path);
$access = get_post_meta($media->ID, '__wpdm_media_access', true);
=====►> if(!is_array($access)) $access = array('public');
$password = get_post_meta($media->ID, '__wpdm_media_pass', true);
...
Please make this change or tell me how to fix my setup and why is not working.
Thanks in advance