3

I am using Webform + Webform_Entity to show webform results as node content used in Views on certain pages.

Here is a screenshot of 1 webform_entity form. The form collects 2 taxonomy terms (from the same Taxonomy which happen to be parent+child) and some random textual questions.

enter image description here

Here is a View config that takes the 2 taxonomy terms and looks for answers to this form to show.

$view = new view();
$view->name = 'student_reviews';
$view->description = '';
$view->tag = 'eap';
$view->base_table = 'node';
$view->human_name = 'Student Reviews';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Student Reviews';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Header: Global: Text area */
$handler->display->display_options['header']['area']['id'] = 'area';
$handler->display->display_options['header']['area']['table'] = 'views';
$handler->display->display_options['header']['area']['field'] = 'area';
$handler->display->display_options['header']['area']['label'] = 'Category CtoolsJumpMenu';
$handler->display->display_options['header']['area']['empty'] = TRUE;
$handler->display->display_options['header']['area']['format'] = 'full_html';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['content'] = 'No feedback found.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Relationship: Content: Webform submission */
$handler->display->display_options['relationships']['webform_submission']['id'] = 'webform_submission';
$handler->display->display_options['relationships']['webform_submission']['table'] = 'node';
$handler->display->display_options['relationships']['webform_submission']['field'] = 'webform_submission';
$handler->display->display_options['relationships']['webform_submission']['required'] = TRUE;
/* Field: Webform Submission: Did you open a local bank account?  Was it easy? */
$handler->display->display_options['fields']['field_eap_feedback051']['id'] = 'field_eap_feedback051';
$handler->display->display_options['fields']['field_eap_feedback051']['table'] = 'field_data_field_eap_feedback051';
$handler->display->display_options['fields']['field_eap_feedback051']['field'] = 'field_eap_feedback051';
$handler->display->display_options['fields']['field_eap_feedback051']['relationship'] = 'webform_submission';
/* Field: Webform Submission: If you did not open a local bank account, was it easy to withdraw money from the ATM?  Which banks were popular & had low ATM fe */
$handler->display->display_options['fields']['field_eap_feedback052']['id'] = 'field_eap_feedback052';
$handler->display->display_options['fields']['field_eap_feedback052']['table'] = 'field_data_field_eap_feedback052';
$handler->display->display_options['fields']['field_eap_feedback052']['field'] = 'field_eap_feedback052';
$handler->display->display_options['fields']['field_eap_feedback052']['relationship'] = 'webform_submission';
/* Field: Webform Submission: Were credit cards widely accepted? */
$handler->display->display_options['fields']['field_eap_feedback050']['id'] = 'field_eap_feedback050';
$handler->display->display_options['fields']['field_eap_feedback050']['table'] = 'field_data_field_eap_feedback050';
$handler->display->display_options['fields']['field_eap_feedback050']['field'] = 'field_eap_feedback050';
$handler->display->display_options['fields']['field_eap_feedback050']['relationship'] = 'webform_submission';
/* Field: Webform Submission: Were there ATMs on campus? */
$handler->display->display_options['fields']['field_eap_feedback053']['id'] = 'field_eap_feedback053';
$handler->display->display_options['fields']['field_eap_feedback053']['table'] = 'field_data_field_eap_feedback053';
$handler->display->display_options['fields']['field_eap_feedback053']['field'] = 'field_eap_feedback053';
$handler->display->display_options['fields']['field_eap_feedback053']['relationship'] = 'webform_submission';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Contextual filter: Field: Survey Country (field_survey_country) */
$handler->display->display_options['arguments']['field_survey_country_tid']['id'] = 'field_survey_country_tid';
$handler->display->display_options['arguments']['field_survey_country_tid']['table'] = 'field_data_field_survey_country';
$handler->display->display_options['arguments']['field_survey_country_tid']['field'] = 'field_survey_country_tid';
$handler->display->display_options['arguments']['field_survey_country_tid']['relationship'] = 'webform_submission';
$handler->display->display_options['arguments']['field_survey_country_tid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['field_survey_country_tid']['default_argument_type'] = 'raw';
$handler->display->display_options['arguments']['field_survey_country_tid']['default_argument_options']['index'] = '1';
$handler->display->display_options['arguments']['field_survey_country_tid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['field_survey_country_tid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['field_survey_country_tid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['field_survey_country_tid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['field_survey_country_tid']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['field_survey_country_tid']['validate_options']['vocabularies'] = array(
  'eap_program_list' => 'eap_program_list',
);
$handler->display->display_options['arguments']['field_survey_country_tid']['validate_options']['type'] = 'convert';
$handler->display->display_options['arguments']['field_survey_country_tid']['validate_options']['transform'] = TRUE;
/* Contextual filter: Webform Submission: Survey Program (field_survey_program) */
$handler->display->display_options['arguments']['field_survey_program_tid']['id'] = 'field_survey_program_tid';
$handler->display->display_options['arguments']['field_survey_program_tid']['table'] = 'field_data_field_survey_program';
$handler->display->display_options['arguments']['field_survey_program_tid']['field'] = 'field_survey_program_tid';
$handler->display->display_options['arguments']['field_survey_program_tid']['relationship'] = 'webform_submission';
$handler->display->display_options['arguments']['field_survey_program_tid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['field_survey_program_tid']['breadcrumb_enable'] = TRUE;
$handler->display->display_options['arguments']['field_survey_program_tid']['breadcrumb'] = 'Student Reviews for %1 - %2 on %3';
$handler->display->display_options['arguments']['field_survey_program_tid']['default_argument_type'] = 'raw';
$handler->display->display_options['arguments']['field_survey_program_tid']['default_argument_options']['index'] = '3';
$handler->display->display_options['arguments']['field_survey_program_tid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['field_survey_program_tid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['field_survey_program_tid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['field_survey_program_tid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['field_survey_program_tid']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['field_survey_program_tid']['validate_options']['vocabularies'] = array(
  'eap_program_list' => 'eap_program_list',
);
$handler->display->display_options['arguments']['field_survey_program_tid']['validate_options']['type'] = 'convert';
$handler->display->display_options['arguments']['field_survey_program_tid']['validate_options']['transform'] = TRUE;
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'eap_responses_banking_' => 'eap_responses_banking_',
);

/* Display: Page: Banking */
$handler = $view->new_display('page', 'Page: Banking', 'page');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Student Reviews';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Field: Survey Country (field_survey_country) */
$handler->display->display_options['arguments']['field_survey_country_tid']['id'] = 'field_survey_country_tid';
$handler->display->display_options['arguments']['field_survey_country_tid']['table'] = 'field_data_field_survey_country';
$handler->display->display_options['arguments']['field_survey_country_tid']['field'] = 'field_survey_country_tid';
$handler->display->display_options['arguments']['field_survey_country_tid']['relationship'] = 'webform_submission';
$handler->display->display_options['arguments']['field_survey_country_tid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['field_survey_country_tid']['default_argument_type'] = 'raw';
$handler->display->display_options['arguments']['field_survey_country_tid']['default_argument_options']['index'] = '1';
$handler->display->display_options['arguments']['field_survey_country_tid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['field_survey_country_tid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['field_survey_country_tid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['field_survey_country_tid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['field_survey_country_tid']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['field_survey_country_tid']['validate_options']['vocabularies'] = array(
  'eap_program_list' => 'eap_program_list',
);
$handler->display->display_options['arguments']['field_survey_country_tid']['validate_options']['type'] = 'convert';
$handler->display->display_options['arguments']['field_survey_country_tid']['validate_options']['transform'] = TRUE;
/* Contextual filter: Webform Submission: Survey Program (field_survey_program) */
$handler->display->display_options['arguments']['field_survey_program_tid']['id'] = 'field_survey_program_tid';
$handler->display->display_options['arguments']['field_survey_program_tid']['table'] = 'field_data_field_survey_program';
$handler->display->display_options['arguments']['field_survey_program_tid']['field'] = 'field_survey_program_tid';
$handler->display->display_options['arguments']['field_survey_program_tid']['relationship'] = 'webform_submission';
$handler->display->display_options['arguments']['field_survey_program_tid']['breadcrumb_enable'] = TRUE;
$handler->display->display_options['arguments']['field_survey_program_tid']['breadcrumb'] = 'Student Reviews for %1 - %2 on %3';
$handler->display->display_options['arguments']['field_survey_program_tid']['default_argument_type'] = 'raw';
$handler->display->display_options['arguments']['field_survey_program_tid']['default_argument_options']['index'] = '3';
$handler->display->display_options['arguments']['field_survey_program_tid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['field_survey_program_tid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['field_survey_program_tid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['field_survey_program_tid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['field_survey_program_tid']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['field_survey_program_tid']['validate_options']['vocabularies'] = array(
  'eap_program_list' => 'eap_program_list',
);
$handler->display->display_options['arguments']['field_survey_program_tid']['validate_options']['type'] = 'convert';
$handler->display->display_options['arguments']['field_survey_program_tid']['validate_options']['transform'] = TRUE;
$handler->display->display_options['path'] = 'student-views/%/%/reviews/banking';

This is a sample of the view query that is run.

SELECT webform_submissions_node.sid AS webform_submissions_node_sid, node.created AS node_created, 'webform_submission_entity' AS field_data_field_eap_feedback051_webform_submission_entity_e, 'webform_submission_entity' AS field_data_field_eap_feedback052_webform_submission_entity_e, 'webform_submission_entity' AS field_data_field_eap_feedback050_webform_submission_entity_e, 'webform_submission_entity' AS field_data_field_eap_feedback053_webform_submission_entity_e, 'student_reviews:page' AS view_name
FROM 
{node} node
INNER JOIN {webform_submissions} webform_submissions_node ON node.nid = webform_submissions_node.nid
LEFT JOIN {field_data_field_survey_country} webform_submissions_node__field_data_field_survey_country ON webform_submissions_node.sid = webform_submissions_node__field_data_field_survey_country.entity_id AND (webform_submissions_node__field_data_field_survey_country.entity_type = 'webform_submission_entity' AND webform_submissions_node__field_data_field_survey_country.deleted = '0')
LEFT JOIN {field_data_field_survey_program} webform_submissions_node__field_data_field_survey_program ON webform_submissions_node.sid = webform_submissions_node__field_data_field_survey_program.entity_id AND (webform_submissions_node__field_data_field_survey_program.entity_type = 'webform_submission_entity' AND webform_submissions_node__field_data_field_survey_program.deleted = '0')
WHERE (( (webform_submissions_node__field_data_field_survey_country.field_survey_country_tid = '25' ) AND (webform_submissions_node__field_data_field_survey_program.field_survey_program_tid = '26' ) )AND(( (node.status = '1') AND (node.type IN  ('eap_responses_banking_')) )))
ORDER BY node_created DESC
  • Some of these content types and fields end with a _, this is because when I made the item the title had punctuation in it and Drupal converts that an underscore. I dont believe it's necessarily breaking anything.

If I install these 2 modules on a clean D7 site with a similar setup I get results in my view. On the live site I get 0 results in the view always. But, webform_entity is clearly collecting results properly and saving entries.

mysql> select * from `field_data_field_eap_feedback051`;
+---------------------------+------------------------+---------+-----------+-------------+----------+-------+-----------------------------+------------------------------+
| entity_type               | bundle                 | deleted | entity_id | revision_id | language | delta | field_eap_feedback051_value | field_eap_feedback051_format |
+---------------------------+------------------------+---------+-----------+-------------+----------+-------+-----------------------------+------------------------------+
| webform_submission_entity | eap_responses_banking_ |       0 |         1 |           1 | und      |     0 | test 2                      | NULL                         |
| webform_submission_entity | eap_responses_banking_ |       0 |         2 |           2 | und      |     0 | asdfasdf                    | NULL                         |
| webform_submission_entity | eap_responses_banking_ |       0 |      1255 |        1255 | und      |     0 | test botswana banking       | NULL                         |
+---------------------------+------------------------+---------+-----------+-------------+----------+-------+-----------------------------+------------------------------+

It appears as though the View is broken. I see the TIDs in the View ok, I see some magic Views placeholders 'webform_submission_entity' AS field_data_field_eap_feedback053_webform_submission_entity_e which I understand are views placeholders ... but I guess aren't being processed correctly for some reason.

Can anyone help me to debug this to see my results. How do I test for conflicting modules? What can I do? .... the View runs -- but i get no results, but I should.

EDIT 01/22/2013 14:17

I'm specifically asking about the Reviews select list and the View page that it jumps to.

  • is it possible to see it online? – Mohammed Shameem Jan 22 '13 at 18:09
  • I have updated the question description. – tenken Jan 22 '13 at 22:21
  • is it possible to give access to the backend? – Mohammed Shameem Jan 23 '13 at 5:28
  • Is your view stored in a custom module or is it in database only? Some time ago I had a problem when rolling in the produciton server a large and complex view I developed in my workstation. There was a query length limitation in Mysql server that was truncating my view configuration. Storing the view in a custom module solved my problem. – ermannob Jan 23 '13 at 8:15
  • Have you cleared the Views cache (under advanced settings) as well as the Drupal cache, after ensuring that if the view is exported in code it is in the "default" state and not overridden? – David Meister Jan 23 '13 at 13:35
0

Solution found! By myself ... The webform_entity parent base node was created in code. Somehow the author field was anonymous on save for all 12 of my webform_entity nodes.

Nodes with anonymous author dont show Views results from the following query (from Views debugging), EVER on related form submissions (using a View relation):

SELECT webform_submissions_node.sid AS webform_submissions_node_sid, node.created AS node_created, 'webform_submission_entity' AS field_data_field_eap_feedback051_webform_submission_entity_e, 'webform_submission_entity' AS field_data_field_eap_feedback052_webform_submission_entity_e, 'webform_submission_entity' AS field_data_field_eap_feedback050_webform_submission_entity_e, 'webform_submission_entity' AS field_data_field_eap_feedback053_webform_submission_entity_e
FROM 
{node} node
INNER JOIN {webform_submissions} webform_submissions_node ON node.nid = webform_submissions_node.nid
LEFT JOIN {field_data_field_survey_country} webform_submissions_node__field_data_field_survey_country ON webform_submissions_node.sid = webform_submissions_node__field_data_field_survey_country.entity_id AND (webform_submissions_node__field_data_field_survey_country.entity_type = 'webform_submission_entity' AND webform_submissions_node__field_data_field_survey_country.deleted = '0')
LEFT JOIN {field_data_field_survey_program} webform_submissions_node__field_data_field_survey_program ON webform_submissions_node.sid = webform_submissions_node__field_data_field_survey_program.entity_id AND (webform_submissions_node__field_data_field_survey_program.entity_type = 'webform_submission_entity' AND webform_submissions_node__field_data_field_survey_program.deleted = '0')
WHERE (( (webform_submissions_node__field_data_field_survey_country.field_survey_country_tid = '25' ) AND (webform_submissions_node__field_data_field_survey_program.field_survey_program_tid = '26' ) )AND(( (node.status = '1') AND (node.type IN  ('eap_responses_banking_')) )))
ORDER BY node_created DESC

even though I'm only looking at node.published = 1 and nothing regarding the author field.

I feel this is a bug somewhere in webform or webform_entity.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.