I just upgraded to 6.x-1.0-rc2 which solved my issue with tokens not working but now I have a new issue.

The user email with download link no longer get's sent out and I see this error print on the "Protected Downloads" settings page for my webform:

warning: Missing argument 4 for webform_protected_downloads_send_mail(), called in /home/amsolut1/public_html/sites/all/modules/webform_protected_downloads/webform_protected_downloads.form.inc on line 265 and defined in /home/amsolut1/public_html/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module on line 604.

I arrived at this error when input my email in the "Send testmail to: " and saved the page. That created a wsod with this error:

Fatal error: Call to undefined function webform_get_submission() in /home/amsolut1/public_html/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module on line 612

When I clicked the back button, I then saw the first error listed above. I have run cron, flushed cache but this does not seem to solve the issue.

CommentFileSizeAuthor
#16 screenshot.png7.06 KBAnandyrh
2011-04-27_11-09-17.png188.54 KBdanny englander

Comments

danny englander’s picture

Just an update, I decided to disable the module and remove the references to it in the database. I then deleted, re-uploaded & re-enabled the module and now the file download email sends but I get a new error (wsod) when I click on the file link from the email to download:

Fatal error: Call to undefined function webform_get_submission() in /home/amsolut1/public_html/sites/all/modules/webform_protected_downloads/webform_protected_downloads.page.inc on line 50

I also tried creating a completely new node / webform with file but that did not help.

I thought this might be an issue with webform itself so upgraded that to 3.9 but it did no good either.

berliner’s picture

Status: Active » Postponed (maintainer needs more info)

No, this is indeed an issue with this module. My fault. Should be fixed in the latest dev. I will see to get a new release out as soon as possible.
Can you try with the latest code from the git repository? Or alternatively wait until the dev release has been updated (might take some hours).

danny englander’s picture

I will be on the lookout for a new dev, it's not crucial at this time so I'll wait -- the site is not live yet, still in development. I'll report back here if I have an issue and then can close or mark as fixed if you like. Thank you again!

berliner’s picture

The updated dev release should be online by tomorrow.

berliner’s picture

Sadly the version generated April 29, 2011 - 01:50 is still broken, so either use the version from the git repository or wait another 12 hours.

John Carbone’s picture

Does this apply to all emails or just to the one sent out as a test? I was right about to deploy this. Glad I checked. :)

berliner’s picture

This concerned only the email sent out as a test. Though, as noted on the project page, the rc2-release is broken and the dev release has not yet been updated. I wonder what has happened with the twice a day rule for dev snapshots.

If you need to deploy this functionality now and you don't need webform token replacement, opt for rc1.
A new release will come soon, but first I need to make sure that the problems have been solved.

John Carbone’s picture

Ahhh, gotcha. OK, thanks for explaining, I appreciate it.

danny englander’s picture

I can confirm the dev from 2011-Apr-28 fixes the error in #2 above so that's actually enough for me to put this in production now as the email is also being sent again. Thanks.

John Carbone’s picture

Hope this doesn't come across offensively, as I really do appreciate your efforts with this module (and this thread for that matter) but why have a "recommended release" that isn't recommended? Downloading via drush gives the rc-2, which shouldn't be used.

berliner’s picture

You're right. The recommended release has been temporarily removed until a new release is out.

berliner’s picture

Version: 6.x-1.0-rc2 » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Fixed

Changing the status to fixed. The problem seems to be solved in dev.

Anandyrh’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc2

Hi,

I face the same issue once after creating the webform as a admin.

warning: Missing argument 4 for webform_protected_downloads_send_mail(), called in /home/------/public_html/-------/sites/all/modules/webform_protected_downloads/webform_protected_downloads.form.inc on line 265 and defined in /home/------/domains/---------/public_html/--------/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module on line 604

I have a sub-domain running as a test site.

Struck with this error after upgrading the module, earlier i used to get the below error.

Fatal error: Call to undefined function webform_get_submission() in /home/-------/domains/-------/public_html/-----/sites/all/modules/webform_protected_downloads/webform_protected_downloads.page.inc on line 50

Please help me to resume this module. I am very much in hurry to update and ask users to register and download files on live site. :)

Thanks a lot & Regards,
AnAnD

berliner’s picture

Version: 6.x-1.0-rc2 » 6.x-1.x-dev

Please see comment #7, the information on the project page and use either rc1 or the current dev version.

Anandyrh’s picture

Thanks a lot for your quick reply Berliner.

I tested the download process as a anonymous user, below mentioned error is seen at the last step after user clicking on file name to download the file.

Access denied
You are not authorized to access this page. 

I also do not see any permission to be set for Anonymous user.

Please suggest some solution(s) to solve this issue,

Thanks,
AnAnD

Anandyrh’s picture

StatusFileSize
new7.06 KB

Hi,
Also i have attached the screenshot of the Private Upload module status.

i was wondering some rewrite rule is causing this issue. because once when user clicks on the file name on the download page it redirects to www.domain.com/system/files/private/filename.jpg for which user may not have permission to access also the directory www.domain.com/system/files/private/ dose not exist on the server.

but the actual file path is like this: www.domain.com/sites/default/files/private/filename.jpg

Anandyrh’s picture

Hi,

I have restored the DB to older version just to ensure if 'Private download' & 'File access' modules are causing this issue. and installed 'Webform Protected Downloads' module again. now if a anonymous user clicks on download file it asking to login to site.

Please help out, Let me know if i am doing something wrong here.

Thanks & Regards,
AnAnD | Drupal | Photographer | Linkedin | Twitter

John Carbone’s picture

Did you change the file system settings at some point? What does it say at admin/settings/file-system/settings? Did you change from public to private download method? This has been known to cause issues.

Anandyrh’s picture

Hi John,

Right now [Public - files are available using HTTP directly.] is enabled, but yes earlier i had enabled [Private - files are transferred by Drupal] once, thought this could be causing issue, So i have restored DB with older version.

Thanks & Regards,
AnAnD | Drupal | Photographer | Linkedin | Twitter

John Carbone’s picture

I think we should really have a new issue ticket for this, but I'd check the files table and make sure the paths are what you expect. If you see paths that include "system" in there that might be the culprit. I'm not 100% on the whole system for private downloads through drupal, but that table is where the file paths are stored. That would be my next move anyway. :)

berliner’s picture

Some explications concerning comment #16:

www.domain.com/system/files/private/filename.jpg
This is the system path to a file, which means that the request is routed through drupal and can be subject to access control. This path should not physically exist on the server.

www.domain.com/sites/default/files/private/filename.jpg
This is the physical storage of the file. For use with private uploads the directory www.domain.com/sites/default/files/private should contain an .htaccess file that prevents direct access.

Anandyrh’s picture

Hi Berliner,

Thanks a lot for the explanation, the reason why i was explaining because when a anonymous user tries to download a file he see a login page. this has been my root cause so far, so i was wondering if Private Upload module is causing this issue.

Thanks & Regards,
AnAnD | Drupal | Photographer | Linkedin | Twitter

Anandyrh’s picture

Status: Fixed » Needs review

I could not find any solution to my problem so far...

Thanks & Regards,
AnAnD | Drupal | Photographer | Linkedin | Twitter

berliner’s picture

Status: Needs review » Fixed

Did you upgrade to the latest stable release, including running update.php and reviewing the protected downloads settings afterwards?
If this doesn't work, please open a new issue as suggested by John Carbone, since the original problem of this issue has been solved.
And please don't set the status of an issue to "needs review" when there is nothing to review.
I reset the status to fixed and expect a new issue for your problem, ok?

Anandyrh’s picture

Hi berliner,

Thanks a lot for the reply..

I have opened a new issue here:
http://drupal.org/node/1166790

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.