Thank you! ๐
I am also moving from a dev website. Could you unlock my key?
Perfect! Thank you, Shahriar! ๐
Hey Guys,
Sorry to keep harassing you about this, but you didn’t fix the bug yet! I updated to WP Download Manager Pro 4.7.4 and all my download pages broke again when Form Lock 1.6.0 is active. My PHP version is still the same (7.1.7) and WordPress is updated to 4.9.4.
In the meantime, I did figure out why my original patch $extralocks = array()
stopped working. That variable is declared as a string in TWO places and I only resolved it in one! Silly me. ๐
So, I am hoping this is my FINAL patch. To fix the issue,
(1) don’t change the Form Lock Add-on, and
(2) re-declare $extralocks as an array around lines 816
AND 923
.
This change is only needed in the class.Package.php
file. I do realize that you just updated Download Manager, so if you want to make your lives a little bit easier, my other patch above for the Form Lock Add-on will still work. It doesn’t matter which fix you pick, as long as the next update doesn’t break my download pages again. I am not always going to be around to fix this manually.
I still love this plugin and am amazed at the flexibility it offers, so I thank you for your efforts in developing it!
Hello again,
After updating to WP Download Manager Pro 4.7.3 and Form Lock 1.6.0, my download pages broke again. I tried re-implementing my patch, setting $extralocks = array()
again, but the value remains as a string and for the life of me I can’t figure out why.
So, new patch! The update reverted the class.Package.php
file to use the original declaration, where $extralocks = ''
, but this time I only modified the Form Lock plugin.
Location: …/plugins/wpdm-form-lock/wpdm-form-lock.php around Line 78
Change this:
if(!isset($extralocks['html'])) $extralocks['html'] = '';
To this:
if (gettype($extralocks) != 'array') {
$extralocks = array();
$extralocks['html'] = '';
}
The better way to do this would be to declare it as an array immediately, but for reasons unknown, passing the variable to the wpdm_download_lock
filter transforms it back to a string.
If I missed something, please let me know. At least for now, this fixes my issue.
I can’t give you a login because the server is private, so even if you had credentials, the development website is still inaccessible to the public.
And Shahriar, unlocking all downloads with one form submission would be nice, but I found a work-around that suits my needs.
I changed the link-template to one that only has the link to the designated download page of the file. Then, I changed that page template to a custom one I made that only shows the extended download link. Since Form Lock is on, this is replaced with the form, so it looks like the page redirected to the form, but is actually on the package page. Filling out the form and clicking “Submit” shows the direct download link as I wanted it to.
Thank you guys for all of your help! Bouncing some ideas off of you helped me figure-out this clean work-around ๐
Video was too large to attach, so see attached screenshots. One shows the current issue and the other is a walk-through of what I’m aiming for.
I am working on a development site on a private server, so I can’t give you the URL. I will work on sending you a screen-recording of what I have, but the software is taking forever to update…
And yes, with Form Lock enabled, I want the download links for the individual packages to stay there when using the [wpdm_category]
shortcode. When the download links are clicked, they will redirect to the form, and after submitting it the direct download button/link for the package will appear.
Thank you, Hasibul! Any ideas for a redirect-to-form option?
Found the error! See below.
Location: …/plugins/download-manager/libs/class.Package.php around Line 889
$extralocks = '';
– The variable needs to be declared as an array, not a string, so the following works:
$extralocks = array();
Will this be fixed in the next update? Also, is it possible to keep the download link with Form Lock enabled and redirect to the form instead of showing it inline with the download description? I have a big form that is used for multiple downloads, so when I use the [wpdm_category]
shortcode, the form is repeated for each link-template on the page.