I am seeing multiple error messages:

Warning: Invalid argument supplied for foreach() in LimesurveySyncInfosToken->schema_ls_fields_variables() (line 343 of /srv/bindings/f4fb368aebef4687999a8e4eaac56f2e/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_token.class.inc).

It looks like it has to do with tokens and I'm wondering if it might have to do with having attributes for the tokens.

Any thoughts?

Thanks

Comments

jsibley created an issue. See original summary.

jsibley’s picture

In case it is part of the same problem, when trying to sync tokens from Limesurvey to Drupal I get this error messsage, as well:

EntityFieldQueryException: Unknown field: field_ls_token_994774 in EntityFieldQuery->addFieldCondition() (line 817 of /srv/bindings/f4fb368aebef4687999a8e4eaac56f2e/code/includes/entity.inc).

Thanks.

jsibley’s picture

I think that part of the problem may be this:

protected function entity_property_info_ls_fields_known($field, $sid) {
    return FALSE;
  }

that is defined and then called in limesurvey_sync_api.class.inc

It looks as though it will always return false, although I'm not a developer and might be missing something.

jsibley’s picture

Hi,

Any chance you could take a look at this?
thi
Although not a developer, I'm trying to get up to speed enough to understand your code but it's slow going.

How are you handling / planning to handle custom attributes added to limesurvey tokens? Would it make sense to use bundles and have the attributes as fields on the bundles?

I realize that you have other priorities, but is there any chance you could take a look at this?

Thanks.

jsibley’s picture

I am no longer getting the original errors mentioned above. I think that they were caused by enabling tokens after adding the survey or because some of the survey parameters weren't set correctly. Since then, I have uninstalled and reinstalled the module.

However, I still get:
Warning: Invalid argument supplied for foreach() in LimesurveySyncInfosToken->schema_ls_fields_variables() (line 343 of /srv/bindings/f4fb368aebef4687999a8e4eaac56f2e/code/sites/all/modules/limesurvey_sync/api/limesurvey_sync_token.class.inc).

This seems to come from:

$attributedescriptions = $this_survey['attributedescriptions'];
    $fields = array();
    foreach ($attributedescriptions as $attribute_field => $datas) {
      $fields[$attribute_field] = $attribute;
      $fields[$attribute_field]['description'] = $datas['description'];
    }

    return (isset($fields[$field])) ? $fields[$field] : FALSE;

Any idea what is going wrong here?

Thanks.

thedut’s picture

Title: Error messages » Warning: Invalid argument supplied for foreach() in LimesurveySyncInfosToken->schema_ls_fields_variables() (line 343 of limesurvey_sync/api/limesurvey_sync_token.class.inc).
Assigned: Unassigned » thedut
Priority: Normal » Minor

Thank you for reporting this issue.
I was aware of this issue, it will be fixed into the next release. In the meantime, don't worry about it. This error message as no consequences on datas.

jsibley’s picture

Might the message, however, have something to do with whether token attributes in Limesurvey are available in Drupal?

Given the current state of version 2.x, might it make sense, when you have time to go back to it, to have a dependency on ECK and take advantage of the functionality it gives for exposing entities and using them in rules and views?

thedut’s picture

Status: Active » Needs review

Hello,

This issue should be fixed in the new dev version. Could you confirm ?

thedut’s picture

Status: Needs review » Closed (fixed)

I set this issue to closed. Feel free to reopen this issue if you still meet this bug.