Support from Acquia helps fund testing for Drupal Acquia logo

Comments

embloo’s picture

Title: Drupal 7 » Webform MySQL Views for Drupal 7
henneman’s picture

Hmm interesting, I'll keep an eye on this one.

FreeFox’s picture

And here another fan ^^

yannisc’s picture

+1

Barfly’s picture

subscribes

toabi’s picture

subscribing

joecorall’s picture

Assigned: Unassigned » joecorall
Status: Active » Patch (to be ported)
FileSize
8.54 KB

Attached you'll find a patch that when applied will make Webform MySQL Views working for Drupal 7. The only thing that will need changed is the webform_mysql_views.info to be altered to allow for installation on Drupal 7.

-Joe Corall

joecorall’s picture

sorry for the poorly named patch file. Attached is a patch that will download properly.

joecorall’s picture

Forgot to remove one line I was using for error checking attached is correct patch

mediaten’s picture

Category: task » support
Priority: Normal » Major

Hi,
Would it be possible, by any chance, to get the final patched version of the module? I've been trying for so many hours to patch as indicated with git...but look like I'm too new get it done. Would be most helpful!

joecorall’s picture

Please use this attachment rather then the patches. I've fixed a few bugs since porting the project.

@mediaten:

Attached you'll find the .zip of my drupal 7 port. I hope this helps until the port is evaluated and added to the project.

After you install it you can add views by going to http://YOUR_DRUPAL_URL/?q=admin/content/webform/mysql

And for applying future patches, here's how you'd apply the patch for this issue :

from the command line type :
# git clone --branch 6.x-1.x http://git.drupal.org/project/webform_mysql_views.git
# cd webform_mysql_views
# mv /PATH/TO/PATCH/Drupal7Port-Issue1089598.patch .
# git apply -v Drupal7Port-Issue1089598.patch

joecorall’s picture

Another bug fix. An if statement was checking if an index was in an array, and this was causing errors if it was a newly created webform. Thanks to mediaten for finding this.

joecorall’s picture

ace11’s picture

Is there any way to use this to bring fields from webform to views without data module (data module is not working with drupal 7)?

I need to get list of people and their info (fields from webform) to node.

mgifford’s picture

Any plans on producing a diff based on the latest version in the git repository? Uploading tarballs with the whole module is harder to push ahead.

Sam5’s picture

Is this the Final complete one for Drupal 7? can Anyone give the final complete pack of Webform_mysql_views module for Drupal 7.x?

joecorall’s picture

@Sam5

I've been using the latest tarball posted to this issue with great success...

I can't port the code to the module since I'm not a contributor - otherwise I'd be more than happy to "officially" support this port... Not sure where usonian (the module creator) is - I've emailed him offering to contribute with no response.

Maybe I should make my own module!?!? Not sure what the protocol is for this... I basically used all his code and "upgraded" it to work with d7.

joecorall’s picture

@mgifford

Here is the diff of my port and the latest d6 version.

Danny Englander’s picture

@jcorall - I have seen other people start sandbox projects (e.g. a Drupal 7 port) when module maintainers have gone missing. Just an idea. At least then there is a temporary way to track and update issues / code.

joecorall’s picture

Status: Patch (to be ported) » Closed (fixed)

Good thinking. Here's the sandbox:

http://drupal.org/sandbox/jcorall/1217148

joecorall’s picture

Status: Closed (fixed) » Patch (to be ported)

on second thought, probably should keep this issue open so others looking for a d7 port can find the sandbox...

tehfnz’s picture

@ace11 Would love to know that as well!

dvales’s picture

Joe
Thanks for providing the D7 ported version. I'm new to drupal and have been looking for a way to display webform submissions. So I really appreciate your efforts.

I installed the module but I still cannot get to the data. I found a nodeone tutorial but it is all drupal 6. The data module is used which is n ot available for Drupal 7. I cannot not find the D6 equivalent menu options in D7. Is there a how to use or a D7 tutorial somewhere?

Thanks again
Dave

joecorall’s picture

Dave,

This module only creates a 'database view' - so you'll only see what this module does if you are looking in the database - it doesn't not provide any vehicle for drupal to display the data in your submitted webforms.

The scope of this module is to allow third party applications to easily access the webform submissions. Unfortunately, there is no way to integrate that data into Drupal's Views module without some additional coding. Though views integration is on its way into the Webform module. See Issue #680386: Views integration for the webform_submitted_data table.

joecorall’s picture

here's the latest patch with the sandbox d7 version and this module's d6 version

joecorall’s picture

FileSize
10.58 KB

better patch - removed some newline errors

joecorall’s picture

FileSize
10.55 KB

removing unnecessary element dependency

kszyhu’s picture

Hi,

I installed Data 7.x-1.0-alpha1 and patched Webform MySQL Views 6.x-1.2 from #27. I wanted to enable the MySQL views containing submission date for your Webforms and I got an error: "Fatal error: Call to undefined function data_include () in /sites/all/modules/webform_mysql_views /webform_mysql_views.module on line 301".
View was not created.
"Data tables" -> tabs "Adobt Tables" is empty.

Any clue?
Thank you for your help.

joecorall’s picture

FileSize
13.24 KB

Hello,

The latest stable version of Webform now has native Views support (see http://drupal.org/node/680386#comment-5406954)

If you need the Data module and this module integrated for some reason other than exposing to Views (which was the only reason the integration was implemented to begin with), I can look further into integrating with Data.

At the time I initially ported this module, Data didn't have a d7 release. Webform was on its way to native Views support, and I simply overlooked removing the code, as it throws no errors if Data isn't enabled. I removed the Data integration code, and it's working.

-Joe

sisko’s picture

I am getting a fatal error which says the database table does not exist
PDOException: SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'webform_views_webform1_2': DROP VIEW {webform_views_webform1_2}; Array ( ) in webform_mysql_views_admin_form_submit() (line 267 of /var/www/test3.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

When I check phpmyadmin, there is no such database table as named after my webform.

My website works fine with the database user details I specified so I assume this is not a database user issue ... unless I am wrong????

Please help!

joecorall’s picture

sisko,

When are you getting this error? When you visit the site, or when you click submit on the Webform MySQL Views admin page?

You could try running the SQL statement CREATE VIEW webform_views_webform1_2 as (select uid from users) in phpMyAdmin, then revisit the site. The error should then go away...

Please include any more information you can, I'd like to eliminate this error from the project's code.

sisko’s picture

Thank you for your speedy response.

I wish I understood the module and mysql better so I could get involved in fixing the issues but I don't.
I hope the following helps you eliminate errors.

Following your advice, I attempted to run the code snippet you sent but I got syntax errors in phpMyAdmin ... I am not familiar with creating VIEWS in mysql so I decided to try the create new table interface under Data Tables. That process worked and my table showed up in phpMyAdmin.

My webform has 2 radio buttons and 1 textfield so I created a table which has SID of type int as primary key, a name field of type text and the 2 radio buttons had type int.
The SID field I 'join'ed on webform_submissions.sid.

In VIEWS, there was a custom view now available. When I visit the page that view generated, I find a nice table fully populated with 0s. I amended the view to include webform_submissions.sid and I get an extra column with the actual submission IDS for all 24 entries submitted through my webform. I have cleared cache several times.

I am not sure where or what is going wrong so I decided to restart the process from the beginning. I went to webforms->mysql views, unselected the webform and clicked submit and got the following error:
PDOException: SQLSTATE[HY000]: General error: 1347 'experimentals.webform_views_webform1_2' is not VIEW: DROP VIEW {webform_views_webform1_2}; Array ( ) in webform_mysql_views_admin_form_submit() (line 267 of /var/www/test3.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).
So, in creating the table via the Data Tables interface, it is not a VIEW and creates errors.

Also, looking around phpMyAdmin, I discovered my user DOES in fact have CREATE VIEW privileges.

sisko’s picture

Strange thing happened! I installed a fresh copy of Drupal 7 and tried the Webform_MySQL_Views module again ... and it worked ... but with a truckload of nasty errors.

Let me know if you require/want any more feedback and I'll give you extensive details.

sisko’s picture

UPDATE:

strange but I repeated the process which gave me some success earlier but this time it did not work.
I duped the databse and re-installed Drupal7 with the intention of coping errors and making them available to you but the DATABASE TABLES area does not show the created VIEW.

Don't want to overwhelm you but I have pasted my findings below:

-------------------------------------------------------------------------------------------------------

Enabled Views UI, DATA UI & Webform MySQL Views
-all the dependent modules were enabled
enabled the Views, Chaos tools modules to install Views UI.
enabled the Data, Schema modules to install Data Admin UI.
enabled the Webform, Elements modules to install Webform MySQL Views.

Created a webform with a textfield, and 2 radio buttons - name it Webform#1
-during configuration for all 3 components, I get the non-fatal error below
ERROR: Notice: Undefined index: 2 in webform_mysql_views_rebuild() (line 113 of /var/www/test4.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

Navigated to Webforms -> Mysql Views, Webform#1 already listed
I check the box next to it and click submit and get the following fatal error:
ERROR:

Warning: fopen(/var/www/cph/t.txt): failed to open stream: No such file or directory in webform_mysql_views_build_query() (line 366 of /var/www/test4.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

    Warning: fwrite() expects parameter 1 to be resource, boolean given in webform_mysql_views_build_query() (line 366 of /var/www/test4.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

    Warning: fclose() expects parameter 1 to be resource, boolean given in webform_mysql_views_build_query() (line 366 of /var/www/test4.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

    PDOException: SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column name 'do_you_weigh_under_51_kgs_8_stone_or_are_you_severely_overweight_check_your_bmi_is_under_35': CREATE OR REPLACE VIEW {webform_views_webform1_2} AS SELECT parent.sid, s.uid,(SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 1) AS `name`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 2) AS `16_or_over_40`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 3) AS `do_you_weigh_under_51_kgs_8_stone_or_are_you_severely_overweight_check_your_bmi_is_under_35`, s.submitted AS submitted, s.remote_addr FROM {webform_submitted_data} AS parent JOIN {webform_submissions} s ON s.sid = parent.sid WHERE parent.nid = 2 GROUP BY parent.sid ORDER BY parent.sid DESC; Array ( ) in webform_mysql_views_rebuild() (line 124 of /var/www/test4.localhost/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

The website encountered an unexpected error. Please try again later.

I navigated back to Webforms -> Mysql Views, Webform#1 still listed and checkbox is selected/checked.

Navigated to DATABASE TABLES and there are no VIEWS listed - END OF THE LINE!!! :-(

joecorall’s picture

You're using an old version of the patch. Replace the folder on your web server under /var/www/test4.localhost/sites/all/modules/webform_mysql_views with the folder you get when you clone the latest version by running the command:

git clone http://git.drupal.org/sandbox/jcorall/1217148.git webform_mysql_views

Also, I noticed the column name `do_you_weigh_under_51_kgs_8_stone_or_are_you_severely_overweight_check_your_bmi_is_under_35` is very long. You may want to reduce the size of that field name in your webform.

If you are experiencing any other issues after updating to the latest version, please visit http://drupal.org/project/issues/1217148 to submit an issue, so this patch issue isn't getting separate issues in it.

mensfort’s picture

Title: Webform MySQL Views for Drupal 7 » Trying desperate to show some sql with my form input...
Category: support » task
Priority: Major » Minor
Status: Patch (to be ported) » Active

I have a WEBFORM and try to do a sql query, but after 4 days I really get enough of Drupal... until I find this page. Let's give it a try. If this does not work also, I stop with Drupal!!! It's really amazing to do standard stuff, but MySQL should not be too difficult to handle I think.

nevets’s picture

Title: Trying desperate to show some sql with my form input... » Webform MySQL Views for Drupal 7

Please not change issue titles and if you are having problems you can post to the forums explaining the problems you are having. And if you have only been using Drupal 4 days, there are probably alternatives to writing SQL that you have not explored.

munisekhar.drupal’s picture

Hi

when I am creating webform mysql views am getting an error

PDOException: SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'webform_views_upload_your_documents_28': DROP VIEW {webform_views_upload_your_documents_28}; Array ( ) in webform_mysql_views_admin_form_submit() (line 267 of D:\xampp\htdocs\financedost\sites\all\modules\webform_mysql_views\webform_mysql_views.module).

help me

joecorall’s picture

@munisekhar.drupal

You're using an older version of the patch. See comment #35

Be sure to read the last line - which details where you should go for help with this module.

joecorall’s picture

Status: Active » Closed (fixed)

Patch ported to 7.x-1.x branch of the main module page. Thanks to cafuego for facilitating the maintainership of this module.

calbert’s picture

I am using the new 7.x-1.x and I am still getting the same error, It's a fresh install of drupal.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'webform_views_outages_form_4': DROP VIEW {webform_views_outages_form_4}; Array ( ) in webform_mysql_views_admin_form_submit() (line 268 of /var/www/vhosts/metrosource/drupal-7/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

joecorall’s picture

There was no need to reopen this issue; you already created another one in the issue queue...

drupaluser_test’s picture

Hi,

I am using drupal 7. I need to create a for for suggestion. There In field one I have four radio buttons (Option 1,Option 2,Option 3,Option 4) and under the radio button I need one text box. User have to select the option 1 radio button and write the suggestion in that text field.

How can I do it in webform?

joecorall’s picture

As a general rule, please don't post comments on issue queues completely unrelated to the question you're posing.

You'd likely have better luck starting a new topic over at http://drupal.org/forum when you have a question such as the one you asked. A module's issue queue (which is where you currently are) is intended to only handle feature/bug/support requests pertinent to the module's scope.

Also, if the issue the thread was started on is completely unrelated to your question, you shouldn't just add to the issue; you should create a new one.

Regardless, I think http://drupal.org/project/select_or_other is the module you're looking for.