I'm not sure if this is a bug or due to something I've done on my end, but I am getting these messages when after submitting a limesurvey response:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision.type' in 'where clause': SELECT revision.dp_rid AS dp_rid, revision.revision_uid AS revision_uid, revision.dp_editing AS dp_editing, revision.dp_back AS dp_back FROM limesurvey_sync_response base INNER JOIN limesurvey_sync_response_revision revision ON revision.vid = base.vid WHERE revision.type = :type AND revision_uid = :revision_uid AND revision.dp_editing > :dp_editing AND revision.dp_back = :dp_back ORDER BY revision.dp_editing DESC; Array ( [:type] => ls_survey_763688 [:revision_uid] => 248 [:dp_editing] => 1457275490 [:dp_back] => 0 ) in limesurvey_sync_invitation_back_from_ls() (line 153 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_invitation.back.inc).
The website encountered an unexpected error. Please try again later. 

Any thoughts about what the cause might be and whether there is something I need to do on my end?

Thanks!

Comments

jsibley created an issue. See original summary.

thedut’s picture

Category: Support request » Bug report

Hello jsibley,

Nice shot, it's a bug.
in /limesurvey_sync/api/limesurvey_sync_invitation.back.inc, replace à line 149:
revision.type = :type
by
base.type = :type

jsibley’s picture

Thanks, that helped.

I can now go to the survey and come back to the page I specify in Drupal (after flushing the cache).

However, there don't seem to be any responses generated using this process.

Here is what I do:

Tokens with attributes are created in Drupal, exported as CSV, and imported into Limesurvey
Link with token is created in a Drupal view
Click on link in view and answer survey
Return to page with Drupal view

I get back to the correct view page but nothing seems to have happened.

Any further ideas?

Thanks.

jsibley’s picture

Also, I should mention that I do get emails saying that "this email is to confirm that you have completed the survey titled...", although I'm not actually seeing any responses in drupal.

thedut’s picture

Hum,
looking at the code I have found antother issue :
in /limesurvey_sync/api/limesurvey_sync_invitation.back.inc, replace at line 209:
$answer = node_load($answer_entityname, array($dp_aid));
by
$answer = enity_load_single($answer_entityname, $dp_aid);
But I guess there is more things to do in order to get it works.
try it and tell me.

jsibley’s picture

Thank you for following up so quickly. Unfortunately, that was not enough to make a difference. I probably should have reported these warnings earlier, as they may also provide some helpful evidence:

Warning: Illegal string offset 'schema_fields_sql' in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'base table' in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, string given in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'schema_fields_sql' in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'base table' in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, string given in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'schema_fields_sql' in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'base table' in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, string given in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'schema_fields_sql' in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'base table' in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, string given in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'schema_fields_sql' in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'base table' in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, string given in limesurvey_sync_api_entity_entity_access() (line 1985 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'schema_fields_sql' in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: Illegal string offset 'base table' in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, string given in limesurvey_sync_api_entity_entity_access() (line 1989 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
jsibley’s picture

I thought that part of the problem might be that I am going straight from my view to the limsurvey site, so I tried clicking on "To response to the survey" (which should be "To respond to the survey"). This gave me the following errors:

Notice: Undefined property: LimesurveySyncEntityLsResponse::$entity_type in limesurvey_sync_api_entity_edit_submit() (line 2550 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Notice: Undefined index: schema_fields_sql in limesurvey_sync_api_entity_edit_submit() (line 2553 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, null given in limesurvey_sync_api_entity_edit_submit() (line 2553 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Notice: Undefined index: schema_fields_sql in limesurvey_sync_api_entity_edit_submit() (line 2566 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Warning: in_array() expects parameter 2 to be array, null given in limesurvey_sync_api_entity_edit_submit() (line 2566 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).
    Notice: Undefined property: LimesurveySyncEntityLsToken::$ls_usesleft in limesurvey_sync_ls_api_token_activate_token() (line 984 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_token.class.inc).
    Notice: Undefined property: LimesurveySyncEntityLsToken::$ls_completed in limesurvey_sync_ls_api_token_activate_token() (line 987 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_token.class.inc).
    Notice: Undefined property: LimesurveySyncEntityLsToken::$ls_tid in limesurvey_sync_ls_api_edit_row() (line 494 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/ls_api/limesurvey_sync_ls_api_fields.inc).
    Notice: Undefined property: LimesurveySyncEntityLsResponse::$filling_url in limesurvey_sync_response_form_submit_redirect() (line 1167 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_response.class.inc).

Warning message

    the LimeSurvey fields ls_attribute_1, ls_attribute_2, ls_attribute_3, ls_attribute_4, ls_attribute_5, ls_attribute_6, ls_attribute_7, ls_attribute_8, ls_attribute_9, ls_attribute_10, ls_attribute_11, ls_attribute_12, ls_attribute_13, ls_attribute_14, ls_attribute_15, ls_attribute_16, ls_attribute_17 have not been imported into Drupal (from token 763688).
    the LimeSurvey fields ls_attribute_1, ls_attribute_2, ls_attribute_3, ls_attribute_4, ls_attribute_5, ls_attribute_6, ls_attribute_7, ls_attribute_8, ls_attribute_9, ls_attribute_10, ls_attribute_11, ls_attribute_12, ls_attribute_13, ls_attribute_14, ls_attribute_15, ls_attribute_16, ls_attribute_17 have not been imported into Drupal (from token 763688).

Thanks for your help!

thedut’s picture

Hello jsibley

There is a new dev version with many fixes. You should try it.
Thanks for the issue you reported in #6 : it is fixed now.

In order to understand the synchronization on coming back to drupal from LimeSurvey :
The 7.x-2.x version was designed to automatically synchronize answers when the answer has been started from drupal, throught
http://yourdrupalsite.com/response/add/ls-survey-xxxxx (or http://yourdrupalsite.com/response/xx/edit)
but not from
http://yourlimesurveysite.com/index.php/xxxxx/tk-wwcs95p82iwf63k
I suppose you start to respond using the http://yourlimesurveysite.com/index.php/xxxxx/tk-wwcs95p82iwf63k url (could you confirm ?)

I have just redesigned the module in order to handle coming back from LimeSurvey even if the user start it not from Drupal. As bonus, depending on the LimeSurvey token email value, the module set correct drupal user as author of the response.

So the synchronization should succeed for you (and your redirection) now.
Test it and tell me.
[EDIT: and please report if all the warnings from #7 are fixed into the new dev version (most of them should be)].

jsibley’s picture

I use the following for the survey:

index.php/survey/index/lang/en/newtest/Y/sid/XXXXXX/token/YYY

where XXXXXX is the survey ID in limesurvey and YYY is the token

With the latest dev release, I get the following upon returning to Drupal and do not see a new response:

Notice: Undefined property: LimesurveySyncEntityLsResponse::$status in limesurvey_sync_api_entity_entity_access() (line 1990 of /srv/bindings/d5019de2668a42eea3bfd694cea81efb/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_api_entity.class.inc).

I'm not against using launching the survey from within drupal, rather than with an external link, but want to be able to use a token that I've created.

One of the reasons I've been doing it this way is that I have a number of attributes associated with the token on the Limesurvey side which I use with conditional logic in Limesurvey to modify the survey. If there is a better way to do this, I'm willing to consider it.

jsibley’s picture

Also, would it be possible in the response entity to have a field that includes just the token id that was used in Limesurvey? That way, I can keep track of which responses have been completed and which haven't been started yet (don't exist).

jsibley’s picture

Hi thedut, any thoughts on the most recent error message I shared above and why the response is not generated?

Thank you.

jsibley’s picture

Hi thedut,

I realize that this project is not a priority for you now, but could you provide any guidance on the error mentioned in #9 above related to the undefined property $status?

I see lss_status in some places, but I don't know enough to know what the problem is or what is supposed to be where.

Many thanks for any help!

Jonathan

thedut’s picture

Hello,

Thank you for reporting this issue. In order to fix it, add
this code

  if ($this->status_col) {
      $default_values['status'] = NODE_PUBLISHED;
    }

line 926, before the "return $info;"

on the api/limesurvey_sync_api_entity.class.inc file.

I will include this fix into the dev version.

thedut’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.