It would be great to have support for profile2 module. For any profile that is configured to be shown as part of user registration, assigning values to fields via token replacement in the same way that username and email fields are filled in would be really handy.

I am doing some work to integrate it here, so I will probably post a patch on this issue in the near future.

CommentFileSizeAuthor
#14 default_token_values_profile2.patch2.46 KBgambaweb

Comments

cameron tod’s picture

OK after spending some time with this it seems there is no integration with the Fields API whatsoever - any registration uses drupal_form_submit and an array_walk function to map form fields to values.

We are currently doing some internal review and may or may not submit a patch.

chrishrtmn’s picture

Subscribing. I'm interested in this as well.

gambaweb’s picture

The basic Gigya user is tokenized so a few solutions:
put gigya tokens as default values in your profile2 fields
1. write a field view formatter that does token_replace to the filed text.
2. use "Token Filter" http://drupal.org/project/token_filter
3. do the token_replace in your filed theaming function.
I just updated the tokens in the dev version

gambaweb’s picture

Version: 7.x-3.1 » 7.x-1.x-dev
Assigned: cameron tod » gambaweb

added a sub module in dev.
I'll be glad to get some use cases so we could improve it.
please read the README.txt file

cameron tod’s picture

So to use this module, I need to have:

  • A profile with the machine name of 'gigya_profile'
  • A comma seperated list of field names defined in this module's admin form
  • Each field name in the profile must match exactly the field names defined in gigya_profile2_fields.inc

Are there any plans to make mappings of from Gigya fields, as opposed to being forced to create profiles in the way that this module expects? I'm sure there are reasonably flexible and straightforward ways to do so using the Entity API.

gambaweb’s picture

I should write a better README file
The module creates a "gigya default profile" with the fields from the default fields from gigya user object you can add extra fields that are in the gigyaUser object defined as extraFields here http://developers.gigya.com/020_Client_API/020_Methods/socialize.getUser...
this the comma seperated list.
there is a hook_gigya_profile2_create_profile_type that fires when the default profile is created.
the module populate the fields.
there is a hook_gigya_profile2_alter to add stuff to the profile when it is created.

cameron tod’s picture

So every time a user signs up it creates a new bundle? Or does it just create a new instance based on the first bundle created?

gambaweb’s picture

it creates a new instance of a profile2 type "gigya_profile"

EvanDonovan’s picture

You apparently have to use the gigya_profile bundle type in order for the Profile2 integration to work correctly. gambaweb, is that correct?

EvanDonovan’s picture

Title: Add support for profile2.module » Document how to use Gigya Profile2 integration
Component: Code » Documentation
Category: feature » task

Changing to a documentation task since the support is there, even if there could be more added. Janrain seems to have a more flexible integration with Profile2 presently, and can also integrate with fields on the User entity.

gambaweb’s picture

yes you should use gigya_profile bundle
we are working on a better implementation

EvanDonovan’s picture

@gambaweb: Does this mean that the gigya_profile fields will soon be deprecated? Do you have a projected release date for a new implementation of this integration? I ask so I know whether to rely on these as part of my IA.

gambaweb’s picture

yes gigya_profile will be deprecated the new implementation will let you have a default value for a field as a gigya token
regardless of where the field is profile2, user etc...
about the release date I'll update this issue as soon as I'll know. it should in the next 2 week or so

gambaweb’s picture

StatusFileSize
new2.46 KB

attached is a patch that adds gigya user info as default values in the gigya_default_profile profile2 editing form

EvanDonovan’s picture

Title: Document how to use Gigya Profile2 integration » Develop Gigya Profile2 integration
Component: Documentation » Code
Category: task » feature

@gambaweb:

Is the Profile2 integration coming back into the Gigya module soon? We will need it in the next week or so (2 at most) for a current project. If you aren't planning on doing it by then, we will need to create something custom.

Would the old Profile2 integration work with the newest release of the module?

gambaweb’s picture

we have new implementation of profile2 (or any other text field) in the 7.x-4.x version it gives you the ability to set gigya token as a default
value for a text filed. in the new version you can use text fields on the user page and not only profile2
the patch above works in the same way only that it works only with profile2

lirand’s picture

EvanDonovan, please try our new version and tell us what you think. We plan to release it as an official version soon. There are no currently known issues in it.

EvanDonovan’s picture

Title: Develop Gigya Profile2 integration » Document Gigya Profile2 integration using Gigya Default Token module
Version: 7.x-1.x-dev » 7.x-4.x-dev
Category: feature » task

Thanks for letting me know that that is the intent of the Gigya Default Token module. I was unaware. Can that be documented more - perhaps it would even be helpful to state that is one of the use cases of the module in the description on the modules page.

I have tested it now, and it does appear to be pulling over some of the information when I set the default token value for a field. However, if there is a field with no data, it seems to trigger a PHP notice like, "Notice: Uninitialized string offset: 0 in text_field_widget_form() (line 510 of /drupal/modules/field/modules/text/text.module)." I can report that as a separate issue if you wish.

gambaweb’s picture

Evan can you please post the steps to reproduce

EvanDonovan’s picture

Two bugs I've observed with Gigya Default Token so far. The latter is more serious.

We can deal with those bugs in their respective issues; this one will be for the documentation of the Gigya Default Token module.

gambaweb’s picture

Status: Active » Closed (fixed)

please change in recent version reopen if still relevant