I have been unable thus far to get the /webform_protected_downloads module working with postgres 8.3. Has any one had success with postgres yet?

First the problem was in private_upload module where I got a syntax error in navigating to http://localhost/drupal/admin/reports/status:

    * warning: pg_query(): Query failed: ERROR: syntax error at or near "REGEXP" LINE 1: SELECT COUNT(fid) FROM files WHERE filepath REGEXP '^private... ^ in /home/najmi/drupal-6.19/includes/database.pgsql.inc on line 139.
    * user warning: query: SELECT COUNT(fid) FROM files WHERE filepath REGEXP '^private_upload' in /home/najmi/drupal-6.19/sites/all/modules/private_upload/private_upload.module on line 185.

So I applied the attached patch patch_private_upload.txt to sites/all/modules/private_upload/private_upload.module and that fixed the problem.

Next I had similar issues (single quote, double quote reversal) when I submitted my test webform with private file attachment. I got the following errors:

    * warning: pg_query(): Query failed: ERROR: column "email" does not exist LINE 10: AND c.type = "email" ^ in /home/najmi/drupal-6.19/includes/database.pgsql.inc on line 139.
    * user warning: query: SELECT DISTINCT s.sid, s.nid, s.submitted, d.data FROM wpd_protected_files f LEFT JOIN wpd_node_configuration n USING(nid) LEFT JOIN webform_submissions s USING(nid) LEFT JOIN wpd_access_hashes p USING(sid) LEFT JOIN webform_submitted_data d ON d.sid = s.sid AND d.cid = n.mail_field_cid LEFT JOIN webform_component c ON c.cid = n.mail_field_cid AND c.nid = n.nid WHERE p.processed IS NULL AND f.created < s.submitted AND c.type = "email" AND c.mandatory = 1 in /home/najmi/drupal-6.19/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module on line 441.

So I applied the attached patch patch_webform_protected_downloads.txt to sites/all/modules/patch_webform_protected_downloads.txt/patch_webform_protected_downloads.module and that fixed the problem.

Now I get the following errors:
{code}
* warning: Attempt to assign property of non-object in /home/najmi/drupal-6.19/sites/all/modules/token/token_user.inc on line 55.
* warning: Attempt to assign property of non-object in /home/najmi/drupal-6.19/sites/all/modules/token/token_user.inc on line 55.
* warning: Attempt to assign property of non-object in /home/najmi/drupal-6.19/sites/all/modules/token/token_user.inc on line 55.
* warning: Attempt to assign property of non-object in /home/najmi/drupal-6.19/sites/all/modules/token/token_user.inc on line 55.
{/code}

Is there something obvious I am missing? Has any one had success with pgsql 8.3 and this plugin?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

berliner’s picture

Hey, thanks for posting this.
Honestly, I have never ever worked with Postgres, so I wasn't aware of any possible problems. Your post made me google and I found http://drupal.org/node/555548.
I committed the changes in your patch and some more in order to prevent future problems like this.

Which version of token do you use? There has already been another issue with tokens that had been solved by updating to the current token version: #940962: Error using Webform and Webform Protected Downloads

berliner’s picture

And it seems to me that you don't use the latest dev version of this module, which might be worth a trial as well.

farrukhnajmi’s picture

Hi Berliner, Thanks for your quick help and for the great plugin module. Some questions follow:

  • Would the latest dev version I should use with drupal 6 be the trunk or the DRUPAL-6--1 branch?
  • Is it normal practice to check it out in a directory: .../sites/all/modules/webform_protected_downloads-DRUPAL-6--1 or does the directory need to be named sites/all/modules/webform_protected_downloads?

I have moved to the latest DRUPAL-6--1 branch for:

  • token-DRUPAL-6--1
  • private_upload-DRUPAL-6--1
  • webform_protected_downloads-DRUPAL-6--1

When I click submit button in webform, I now get no errors (good) and the UI says "Thank you, your submission has been received. Go back to the form ". It never gives the success message and I never get any emails (bad). I have checked spam folders. I have also tried the submit as authenticated and unauthenticated user. Still no joy. There are no errors in apache log.

BTW when I edit the form I see a warning in the top of the edit tab: "warning: Parameter 1 to theme_private_upload_form() expected to be a reference, value given in /home/najmi/drupal-6.19/includes/theme.inc on line 656."

Any ideas what the problem is?

farrukhnajmi’s picture

FileSize
31.71 KB

I am attaching a screenshot of the File attachment section of the Edit tab of the webform.
What are the various check box and 1 drop down combo fields without any labels?

Also whye am I seeing error: "warning: Parameter 2 to webform_protected_downloads_form_alter() expected to be a reference, value given in /home/najmi/drupal-6.19/includes/common.inc on line 2883."

Lastly, can this module be used for files that are very biug (say 70GB)? What if anything needs to be different for large files?

berliner’s picture

Hi,

Would the latest dev version I should use with drupal 6 be the trunk or the DRUPAL-6--1 branch?

DRUPAL-6--1 branch

Is it normal practice to check it out in a directory: .../sites/all/modules/webform_protected_downloads-DRUPAL-6--1 or does the directory need to be named sites/all/modules/webform_protected_downloads?

Yes, no problem as long as you don't have another webform_proteced_downloads directory in the modules directory. And you need to clear the cache too.
BTW: by now you could have used the Download from the project page, it get's updated every 12 hours.

I have moved to the latest DRUPAL-6--1 branch for:

token-DRUPAL-6--1
private_upload-DRUPAL-6--1
webform_protected_downloads-DRUPAL-6--1

I didn't test with the development version of token so I don't know if that can introduce additional problems.

When I click submit button in webform, I now get no errors (good) and the UI says "Thank you, your submission has been received. Go back to the form ". It never gives the success message and I never get any emails (bad). I have checked spam folders. I have also tried the submit as authenticated and unauthenticated user. Still no joy. There are no errors in apache log.

Did you configure webform_protected_downloads for the webform? This is done on another section of the node, on the tab "protected downloads" It is accessible only after files have been attached. Note that the private checkbox you see on the upload form is not generated by my module but by the private upload module.

If you didn't set attached files as protected using the "protected downloads" tab then it is normal that no mails are send.

BTW when I edit the form I see a warning in the top of the edit tab: "warning: Parameter 1 to theme_private_upload_form() expected to be a reference, value given in /home/najmi/drupal-6.19/includes/theme.inc on line 656."

Any ideas what the problem is?

There are some general problems in the private uploads module. You could try to use the second patch I propsed in #948630: 'Private' checkbox disappears if validation fails.

berliner’s picture

I am attaching a screenshot of the File attachment section of the Edit tab of the webform.
What are the various check box and 1 drop down combo fields without any labels?

This is probably related to #812194: Table is not rendered in file attachments fieldset. I would look into this but I couldn't yet reproduce this behaviour.

Also whye am I seeing error: "warning: Parameter 2 to webform_protected_downloads_form_alter() expected to be a reference, value given in /home/najmi/drupal-6.19/includes/common.inc on line 2883."

That is a good question. What php version are you running?

Lastly, can this module be used for files that are very biug (say 70GB)? What if anything needs to be different for large files?

You can use what ever file you can use with the default drupal upload module. Personally I don't have experience with files that big, but I think it should be totally possible as long as your server is correctly configured.

farrukhnajmi’s picture

You are right. The first issue is indeed: #812194: Table is not rendered in file attachments fieldset.
Apparently the "warning: Parameter 2 to webform_protected_downloads_form_alter() expected to be a reference, value given in /home/najmi/drupal-6.19/includes/common.inc on line 2883." is related to the same issue.

I have sorted out the large file issue using this resources for php5 config: http://www.radinks.com/upload/config.php. I had to change the following parameters too 100M: post_max_size, upload_max_filesize.

I have also reverted to the token-6.x-1.15 that you have tested with. No change from trunk was observed.
I am now running on mysql just to be safe.
I am running on php 5.3.2-1ubuntu4.5

So now I am stuck on one last issue and it is the big one. Why is there no email being sent? I have configuredwebform_protected_downloads for the webform. Still no joy.

BTW, I am trying this on my local server. Do I need anything special like an smtp server to be turned on to be able to send email?

I am eager to help you debug this over IM and skype (coordinates sent separately).

farrukhnajmi’s picture

It appears the problem was that I did not have the smtp module (and phpmailer inside smtp module top level directory) installed. Doing so fixed the problem. Please consider adding that module as a dependency as it may not be obvious to some folks. Now that email is being sent I need to play with teh configurations to get it to look better.

berliner’s picture

Hm, I don't need that module on my localhost. I can send email to my localhost straightaway, e.g. berliner@localhost. For me, this is completely sufficient for testing. And on a real testing or production server everything needed should be installed.

berliner’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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