Hi,

I decided that I should start over, getting rid of 2.x and loading 3.x-dev. I'm not sure whether it is possible to migrate easily from the previous version, and there probably aren't many users who need to worry about that.

So, I have two possible scenarios and I'm not sure how feasible either one is without some modifications.

In both scenarios, a user may need several tokens to participate in surveys and I would like to create the tokens in Drupal using VBO and rules, then sync them to LS.

In scenario A, the users already exist in Drupal and a view will create all of the necessary fields to create tokens with customized fields

In scenario B, the participant info exists in Drupal and a user will be created in a rule, then tokens will be created using that user ID

At least one problem is that if I try to create a token entity in my rule, there is a required field for the token ID. I need to create a unique token ID before the token is saved. If I am going from Drupal to LS, couldn't the token ID be the entity ID and not a field that needs to be filled when defining the rule?

I'm not sure what else I might run into, but I thought that it would be helpful to have a workflow in mind. For example, I would send each participant / user one invitation from Drupal, not one invitation per token. The participant / user will click on links in a view to get to each survey that needs to be completed.

This seems to be getting very close to what I was hoping for! Thank you.

CommentFileSizeAuthor
#2 limesurvey sync ls tid issue.PNG28.76 KBjsibley
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jsibley created an issue. See original summary.

jsibley’s picture

So, in theory I can create a unique token ID in PHP and store that to a token entity in a rule. However, I'm having trouble getting VBO to use the rule component that would do this.

In the meantime, I thought I would create some tokens manually for a couple of existing users. I notice that the ls_tid is set to 0 for each of these tokens (please see the attached image). Won't that be a problem?

Also, since the token entity references a user, wouldn't it make sense for the limesurvey first name, last name, and email address to be set when creating the token?

And, if the token references a user, it would be nice to be able to fetch the user record by ID, but that doesn't seem to be working. I seem to have access to [dp-token:lss-uid:uid] in my rule component, but that doesn't seem to work with fetch entity by ID. Any idea why not, and why I can't get [dp-token:lss-uid]?

Thanks.

thedut’s picture

Hi johnathan,

I will answer to your questions soon !
Just for your information, Rules were buggy, that why you met those issues.
It is fixed now. you should be able to sync users and LimeSurvey Token. The token value (something like 't0rNA4LyjLl0rAH') will be automatically generate if empty.
Try again, using both dev versions :
- LimeSurvey Sync v7.x-3.x, updated few minuts ago.
- and Customizable entities v7.x-1.x.

jsibley’s picture

I'm looking forward to trying this. As of 8:48 pm US ET, drush rl is still showing:

Project Release Date Status
limesurvey_sync 7.x-3.x-dev 2016-Sep-08 Development
limesurvey_sync 7.x-3.0-beta1 2016-Sep-06 Supported
limesurvey_sync 7.x-2.x-dev 2016-Jun-18 Development
limesurvey_sync 7.x-1.8 2016-Feb-26 Supported, Recommended
limesurvey_sync 7.x-1.x-dev 2016-Feb-26 Development

Is this much of a delay normal?

jsibley’s picture

Hi Julien,

If I am creating the token on the Drupal side before syncing to LS, how does the token id get created if "create entity" for token requires the _ID, LIMESURVEY TOKEN ID field when creating the rule?

Perhaps the field should not be marked required?

Thanks.

jsibley’s picture

I'm sorry, but another workflow question while you are working on this.

Do we have to create the token table on LS first, adding additional token attributes and naming them in LS?

If not, what is the workflow for adding token attributes on the Drupal end and providing attribute names that will then be synced to LS?

Thanks.

  • thedut committed 7bdab11 on 7.x-3.x
    Issue #2798217 : Make Token ID not required for creating token using...
thedut’s picture

If I am creating the token on the Drupal side before syncing to LS, how does the token id get created if "create entity" for token requires the _ID, LIMESURVEY TOKEN ID field when creating the rule?

Perhaps the field should not be marked required?

I have just commited it, but I may rollback, making the ls_tid property required again. As a work arround, you could instead tiping 0 to the LimeSurvey Token ID value to solve this (even if ls_tid is required).

Do we have to create the token table on LS first, adding additional token attributes and naming them in LS?

--> Definitively Yes
After adding token attributes from the LimeSurvey admin interface, just refresh your Drupal cache and those new attributes will be availables on Drupal.

If not, what is the workflow for adding token attributes on the Drupal end and providing attribute names that will then be synced to LS?

--> Attributes are only created on LS.
But, you could add Text fields to Drupal Users (as "firstname", "lastname", "birthday date", etc...) and map (using Rules) those user fields to your LimeSurvey token datas ("firstname", "lastname", "attribute_1", etc...).

thedut’s picture

About token ls-tid, if you synchronize from drupal to limesurvey the created token, a LimeSurvey token entry will be generated into the LimeSurvey database and the ls_tid will be automatically fill.

thedut’s picture

About your wokflow :

In scenario A, the users already exist in Drupal and a view will create all of the necessary fields to create tokens with customized fields

That point is not clear to me. My suggestion is to create token entities storing the "necessary fields". Maybe that is you have in mind.

In scenario B, the participant info exists in Drupal and a user will be created in a rule, then tokens will be created using that user ID

Ok so you could use the component Rules LimeSurvey sync Token XXXXXX : create user from LS if not exists that come with the LimeSurvey Sync module.

If a user have many tokens, I suggest you create a view listing the LimeSurvey token entities for that user (filter on lss_uid) and filter by the token status, in order to display only the remaining token invitations.
In order to make the views functionnal, the Token entities for that user must exists in Drupal before the user start its responses. In order to the token entities exist in drupal you shoud create them from Drupal and synchronize them from Dp to LS (my prefered method) or create them on LS then importing them from LimeSurvey to Drupal.

A good workflow for your project depends on a good comprehension of your project.
For now, I don't understand your project. So it's difficult to advise you on your workflow. A Skype talk may help.

In my opinion, as far as I can understand your project, the LimeSurvey Sync module v3.x may make it real.

thedut’s picture

Status: Active » Closed (works as designed)