I just started using this module so I'm not sure if it ever worked with PostgreSQL. Using PostgreSQL 8.4.8, PHP 5.3.2, and Drupal 6.20, when trying to create a new Webform Report I see the error message "Error - Webform is not set for this report - cannot proceed. Please delete and re-create this report." Also, the "Webform" field is blank and cannot be changed.

When I save the new Webform Report, I get error messages in the logs due to backticks in the SQL (introduced because of this issue), which PostgreSQL does not like. When these backticks are removed (which I know would break MySQL 4.1 support), the errors no longer appear upon creating a new Webform Report, but I still see the ""Error - Webform is not set for this report..." message and cannot select a Webform.

Unless I'm totally missing something, this module is currently unusable with PostgreSQL. Any assistance would be appreciated.

CommentFileSizeAuthor
#3 1157124.patch770 bytesjimbullington

Comments

ChrisLaFrancis’s picture

Title: PostgreSQL Compatibility » Incorrect arg() Index Preventing New Webform Reports From Being Created

Sorry, after digging a little bit deeper, this is two separate issues.

It looks like the reason the error message "Error - Webform is not set for this report - cannot proceed. Please delete and re-create this report." and the "Webform" field is blank and cannot be changed when trying to create a new Webform Report is that the index passed to arg() on line 315 of webform_report.module should be 2 instead of 1. Once I changed this, I was able to create new Webform Reports without any problems.

As far as the backticks / PostgreSQL issue, I'm going to reopen the issue that caused that changed to be made.

star-szr’s picture

I ran into this as well, it worked fine on a local development server where the site was just being hosted out of a subdirectory, but would not work on the production server without patching this. MySQL 5.x in both cases, same versions of Drupal (6.14 - I know), PHP 5.3.3 on dev server, 5.2.13 on production server.

jimbullington’s picture

Status: Active » Needs review
StatusFileSize
new770 bytes

Thank you for the report and the patch. However, I think we need to get rid of arg() altogether and replace with:

  // if adding a new report, ask for the webform
  if (!isset($node->nid)) {
    $form['wnid'] = array(

Please try the attached patch.

star-szr’s picture

Works for me!

ChrisLaFrancis’s picture

Also working for me. Thanks!

jimbullington’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! I'll upload this patch with the next push.