Hello,

I get the following error when trying to edit the webform report after it has been created:
Error - Webform is not set for this report - cannot proceed. Please delete and re-create this report.

I have exported the database and drupal codebase to my local machine for debugging and it immediately worked without any changes on my part to the config or modules.

I am using the latest versions of Drupal 6.20, Webform 6.x-3.6 and the RC1 for Webform Report.

The only difference is the version of the MySQL database 4.1.22 on the production server where it does not work, and the version of the MySQL database 5.1.44 on my local dev machine.

Webform has a minimum requirement of MySQL 4.1+ so this should work right?

Thanks!
Chris

CommentFileSizeAuthor
#10 1057742.patch4.16 KBjimbullington
#5 1057742.patch1.59 KBjimbullington
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jimbullington’s picture

Status: Active » Postponed (maintainer needs more info)

I don't think the module is doing anything that would require MySQL 5, but I'm afraid I don't have MySQL 4.1 to test with...

Can you send me the structure of your 4.1 webform_report table and see if the report you generated contains a value in the wnid column of the webform_report table.

Thanks for your help!

chris.guitarte’s picture

Hi Jim,

Thanks for your reply,

I created a new Webform Report but the wnid column was empty.

The permissions are the same on both machines for the db_usr:
Data
SELECT
INSERT
UPDATE
DELETE
Structure
CREATE
ALTER
INDEX
DROP
CREATE TEMPORARY TABLES
Administration
GRANT
LOCK TABLES
REFERENCES

Here's the table structure for the webform_report on 4.1:
Field Type Null Default
nid int(10) No 0
wnid int(10) No 0
description text No
columns text No
filters text No
sorton text No
options text No

Indexes:
Keyname Type Cardinality Field
PRIMARY PRIMARY 0 nid

-Chris

jimbullington’s picture

Thanks for the info. It looks like the table def is correct.

Maybe you could dump the node object in the webform_report_insert() function and see if wnid is set. Insert:

echo '<pre>';
print_r($node);
echo '</pre>';
die();

at around line 237 in webform_report.module. This should display the node object before it is inserted.

Also, I assume you've looked at the log and there are no database errors there?

chris.guitarte’s picture

Hi Jim,

I haven't seen any database errors.

I added the node object print and here's the output:
stdClass Object
(
[uid] => 1
[created] => 1297715433
[type] => webform_report
[language] => en
[changed] => 1297715433
[title] => Test Webform Report 2
[description] =>
[wnid] => 13
[revision] => 0
[log] =>
[name] => admin
[date] =>
[status] => 0
[promote] => 0
[sticky] => 0
[op] => Save
[submit] => Save
[preview] => Preview
[form_build_id] => form-89afacec9bc0ac929a16171dc8b02dcd
[form_token] => fdfdcf7af1dfd3dc833f35de2091091c
[form_id] => webform_report_node_form
[comment] => 0
[menu] => Array
(
[mlid] => 0
[module] => menu
[hidden] => 0
[has_children] => 0
[customized] => 0
[options] => Array
(
)

[expanded] => 0
[parent_depth_limit] => 8
[link_title] =>
[parent] => primary-links:0
[weight] => 0
[plid] => 0
[menu_name] => primary-links
)

[path] =>
[pathauto_perform_alias] => 1
[teaser] =>
[format] => 0
[validated] => 1
[og_theme] =>
[is_new] => 1
[body] =>
[timestamp] => 1297715433
[vid] => 27
[moderate] => 0
[tnid] => 0
[translate] => 0
[nid] => 27
[columns] => Array
(
)

[sorton] => Array
(
)

)

jimbullington’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.59 KB

Thank you for supplying this information and thank you for your patience. I think I've figured it out - columns is apparently a reserved word in MySQL 4.1 so the INSERT was failing. I escaped columns in the queries and it appears to be working. Please try the attached patch.

chris.guitarte’s picture

Status: Needs review » Closed (fixed)

Hi Jim,

I updated to the RC2 version and applied the patch to that.

Tried it out on my test dev machine to make sure it still works with the later version of MySQL 5 and then uploaded to the sever with MySQL 4.1 and it works too.

Thanks for your attention and prompt replies!
-Chris

jimbullington’s picture

Committed to CVS

ChrisLaFrancis’s picture

Status: Closed (fixed) » Needs work

It looks like adding the backticks breaks PostgreSQL (8.4.8) compatibility. With the backticks in place, I received multiple messages in the logs about syntax errors and operators not existing. Removing the backticks fixes the problem.

jimbullington’s picture

We probably just need to bite the bullet and do an update to rename the columnsfield to something else... Any suggestions anyone? I wasn't very clever - apparently :-(

jimbullington’s picture

Status: Needs work » Needs review
FileSize
4.16 KB

After further thought, I've decided to just make allowance for PostgreSQL in this patch - MySQL 5 is required in Drupal 7, so the reserved word issue will go away - since it is only an issue in MySQL 4.1. INSERT and UPDATE queries are not allowed in D7 as well so this section will have to be reworked anyway.

Please try the attached patch for 6.x-2.x-dev.

ChrisLaFrancis’s picture

Looks like this is working for me with PostgreSQL. Thanks!

jimbullington’s picture

Status: Needs review » Reviewed & tested by the community

Will upload with the next push.

ChrisLaFrancis’s picture

Just FYI, looks like this patch still needs to be manually applied with the latest dev.

ChrisLaFrancis’s picture

Not trying to be annoying, but just wanted to remind you about this patch... still needs to be manually applied to the latest dev.