I get the following error when trying to use the 7.x-1.0 version

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).

Comments

joecorall’s picture

Priority: Critical » Major

Why did you mark this critical? Is your entire site down from this (I doubt it)? See http://drupal.org/node/45111 for an explanation of Priority statuses.

Have you tried uninstalling, and reinstalling the module? It sounds like you somehow have an old systems variable in your database, referencing an old VIEW created by this module...

If you don't want to uninstall/reinstall, you could also try running the following SQL command, and then try clicking "submit" again at the Webform MySQL Views admin page. It may get rid of the errors.

CREATE VIEW webform_views_outages_form_4 AS (select name from users where uid = 0)

joecorall’s picture

Priority: Major » Normal
calbert’s picture

Sorry if I was wrong with the priority, for me this is site stopping. I am switching us from drupal 6 to drupal 7 and yes my site is almost 100% webforms, that employees here fill out that I then use with mysql views to display the results into a grid ( or the old 6.x version was) This being down, puts me at a stand still for any continued site building

I have tried uninstalled and reinstalling the module, it's a fresh copy of drupal 7.14 with new Views 7.x-3.3 webform 7.x-3.17 & Webform MySQL Views 7.x-1.0

calbert’s picture

Where would I run that command?

calbert’s picture

I tried running the command above ( in the mysql directory ) and I get an even worse error now,

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column name 'what_if_any_corrective_action_is_recommended_in_order_to_avoid_this_outage_in_the_future': CREATE OR REPLACE VIEW {webform_views_outages_form_4} 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 `ticket_number`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 2) AS `state_and_severity_of_the_outage`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 3) AS `outage_status`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 4) AS `affected_headend`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 5) AS `affected_street`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 6) AS `affected_town_state`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 7) AS `who_did_support_contact_and_assign_outage_to`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 8) AS `ogm_message_put_up_by_support`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 9) AS `conference_bridge_being_used__if_any_for_updates`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 10) AS `date__time_of_outage_reported_to_support`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 11) AS `method_of_outage_determination`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 12) AS `email_address_of_person_filling_outage_report`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 13) AS `name_of_person_filling_outage_report`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 14) AS `total_customers_affected`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 15) AS `total_data_subsaffected`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 16) AS `total_business_subs_affected`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 17) AS `total_voice_subs_affected`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 18) AS `nodes_affected`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 19) AS `outage_type`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 20) AS `notes`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 21) AS `party_contacted_to_resolve_this_outage`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 22) AS `what_was_the_cause_of_the_outage`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 23) AS `what_was_the_implemented_resolution_to_the_outage`, (SELECT GROUP_CONCAT(data) FROM {webform_submitted_data} AS child WHERE child.sid = parent.sid AND cid = 24) AS `what_if_any_corrective_action_is_recommended_in_order_to_avoid_this_outage_in_the_future`, FROM_UNIXTIME(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 = 4 GROUP BY parent.sid ORDER BY parent.sid DESC; Array ( ) in webform_mysql_views_rebuild() (line 120 of /var/www/vhosts/metrosource/drupal-7/sites/all/modules/webform_mysql_views/webform_mysql_views.module).

joecorall’s picture

I'm pretty sure the field key "what_if_any_corrective_action_is_recommended_in_order_to_avoid_this_outage_in_the_future" for your webform "webform_views_outages_form" is way too long.

Try editing your webform fields, and shortening the name of the field key considerably. Maybe try naming it something simple like "correction_recommendation"

Please let me know if the renaming of the field fixes the issue, and I'll address the field length in the source code to alert users their field names are too long.

joecorall’s picture

Actually, I just created a webform with that long of a name - and sure enough it threw the same error. I shortened the field key string, and presto everything is working.

So you'll need to shorten the field key for "what_if_any_corrective_action_is_recommended_in_order_to_avoid_this_outage_in_the_future". I'll update the code to catch this exception.

Thank you for reporting it!

calbert’s picture

Great,

I don't see the errors now when I add or remove the check on my webform under MySQL views.

The problem is it's doesn't seem to be adding any of the fields from the webform. I'll try removing the module and uninstalling it as well.

In the 6.x version when I ran the mysql views on a form and then went into views to add a new view I saw that form under Content my form view was listed there.

Like so " Webform: Outage Form
Data table for webform_mysql_view webform_views_outage_form

Any idea's why this isn't working?

calbert’s picture

Ok,

I tried and uninstall of the module and then reinstalled it and I no longer get the error, it adds and removes the check mark perfect in mysql views.

The problem still lies with it not add any of the fields from the form into views. Any thoughts?

joecorall’s picture

As discussed here, this module does not provide integration with Webform and Views, since Webform is working on providing that support in the module.

All this module is intended to do with the d7 version is provide a MySQL View of your webforms - not feed that input into Views.

calbert’s picture

This has been changed from the 6.x version?

If that's the case, I guess I'll rewrite my project case and not switch to Drupal 7 as a great deal of the site is webform's outputted into different views.

In 6.x when I add a new view one of the choices is the mysql_view_(formname) and it has all the form fields

joecorall’s picture

As I said - the Webform module has Views support in d7 - so duplicating Drupal Views support in this module is pointless. You probably can do what you're trying to do with just the Webform module, and you will likely have no need for this module.

joecorall’s picture

Assigned: calbert » joecorall
calbert’s picture

Sorry for the slow reply I've been out with a horrible cold. Where would I go next to get my webform fields useable in a View? Should I move over to the webform issues or Views Issues?

joecorall’s picture

You may want to subscribe to the thread in Webform detailing the progress of Views intergation

#680386: Views integration for the webform_submitted_data table

robloach’s picture

MySQL has a 64 character column name limit. The column name posted in #5 has a count of 88 characters. The issue is using the full field name in the database column. We need to either truncate the column name, or use a field mapping mechanism.

loopy1492’s picture

Has there been any movement on the "truncation needed for column name" issue? It's causing devastation in a project I'm working on. Is anyone working on a patch?

http://drupal.org/node/1990400
http://drupal.org/node/1825066

Thanks
=Adam=

loopy1492’s picture

You can at least allow Drupal to uninstall properly by ignoring the offending form view. Change the webform_mysql_views/webform_mysql_views.install to this:

<?php

/**
 * @file
 * Webform MySQL Views module install/schema hooks.
 */

/**
 * Implements hook_uninstall().
 */
function webform_mysql_views_uninstall() {
  //Get list of Webform MySQL views in the system, and drop them
  $views = variable_get('webform_mysql_views_views', array());
  foreach ($views as $key => $val) {
    if ($val !='name_of_offending_form_view_from_error_message_here_the_one_with_the_number_at_the_end'){
    	db_query("DROP VIEW {" . $val . "}");
    }
  }

  //Delete module's variables
  variable_del('webform_mysql_views_meets_reqs');
  variable_del('webform_mysql_views_views');
}

If you have multiple offending forms, you'll have to add more to the conditional.

After doing this, disable the module, then uninstall it. It should work. Then you can go back and fix the form and try again.

loopy1492’s picture

Also note that this not only happens when there is a field with a large name, but also when there are fields with the same Field Key. Drupal DOES allow multiple fields to have the same Field Key in certain contexts, but this module doesn't like that.

joecorall’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)