Hi im using Drupal 7

I have a website where either artists or suppliers will be registering and posting to their profile. When they register they need to choose between Artist or Supplier, I've tried Profile 2 but cant see where to give people the option.

Each profile will have different fields; artists images, bio and suppliers: company name etc

can anyone help

Comments

abhishek sawant’s picture

Can use Auto assign role module (http://drupal.org/project/autoassignrole) which gives an option to select an role while registering and redirect to a particular register form.

Abhishek Sawant
Drupal Developer

Polyspiral’s picture

hi and thanks, not sure if this will work as Content Profile doesn't support Drupal 7
thanks anyway

nevets’s picture

There is a dev version of the auto assign role module which would to work with either profile 2 or core profiles modules.

Polyspiral’s picture

Hi, thanks you're right its Roles and profile 2 I need, but I cant seem to access the Profile 2 fields in Views, in order to show users work etc

any help is appreciated

nevets’s picture

profile 2 just uses content types so you should be able to list those in views.

Polyspiral’s picture

Hi, thats what I thought.

I created 2 profile types, then I went into views and I cant find the fields I put in to use them in a page view :(

nevets’s picture

What type of view (what is it set to display)? Are you making a view that displays fields or nodes?

When you say you create two profile types do you mean you created two content types?

abhishek sawant’s picture

If you want to add profile fields into views then :
1. click on "Add new view".
2. From drop down select "profile type" after that from "Display format" select "unformatted" of "fields" .
3. click continue & Edit.
4. Now Add an relationship from advanced setting.
5. Now check the check box "Profile type: Profile" from "Relationship" setting.
Now you will be able to view your custom profile fields under "Add fields" section in view.
Hope it helps.

Abhishek Sawant
Drupal Developer

Polyspiral’s picture

Hi and thanks, nearly works I can now select fields from the profile 2 but now get this error on the view page:

Notice: Undefined index: entity keys in views_handler_field_field->query() (line 141 of /var/www/vhosts/xxx.co.uk/httpdocs/modules/new/views/modules/field/views_handler_field_field.inc).

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS profile_type_, 'profile2' AS field_data_field_profile_first_name_profile2_ent' at line 1

and on the page with the block

In red:
Notice: Undefined index: entity keys in views_handler_field_field->query() (line 141 of /var/www/vhosts/xxx.co.uk/httpdocs/modules/new/views/modules/field/views_handler_field_field.inc).

In green:
'Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'AS node_, node.created AS node_created, \'profile2\' AS field_data_field_creative_\' at line 1'
in views_plugin_query_default->execute() (line 1380 of /var/www/vhosts/xxx.co.uk/httpdocs/modules/new/views/plugins/views_plugin_query_default.inc).

is there something Im doing wrong?
thanks for all your time and help so far

abhishek sawant’s picture

can you briefly explain how did you configure a view display for profile listing ?

Abhishek Sawant
Drupal Developer

Polyspiral’s picture

Hi and thanks I did what you said + made it a block and added custom fields like Image, first name and last name

Im need to show lots of profiles with an image and artist name, which will be linked to their profile once clicked

this is what I did

2. From drop down select "profile type" after that from "Display format" select "unformatted" of "fields" .
- Added as a block
- I've also tried Profile (and selected the profile type from the drop down menu here) instead of Profile Type but get the same error

3. click continue & Edit.
- at this point when I click save I get the error:

Notice: Undefined index: node in views_handler_field_field->access() (line 73 of /var/www/vhosts/xxx.co.uk/httpdocs/modules/new/views/modules/field/views_handler_field_field.inc).

But I can see the profile fields in the preview at the bottom despite the errors

4. Now Add an relationship from advanced setting.
- I've tried adding: Profile: Creative type, but at this point I can see the fields I need (Image, First name and Second name)

5. Now check the check box "Profile type: Profile" from "Relationship" setting.
Now you will be able to view your custom profile fields under "Add fields" section in view.
- When I do this I get this error message:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS profile_, 'node' AS field_data_field_first_name_node_entity_type, 'node' AS f' at line 1

thanks again for your help and time, its really appreciated, if you can help a little more that would be fabby

Polyspiral’s picture

Sorry do you mean the fields?

I went to Profile types and added the 'creative' profile, then added the fields in there then created a user and filled in the fields as that user.

Does that help

anshuljain2k8’s picture

Ok, First I created an 'creative' profile by visiting "profile type" setting and make visible on user registration page and added multiple fileds ( artist name, Imgae etc.). After that I created an dummy user with profile details.
For display of profile listing, I created a view by using following steps :
1. Go to _http://localhost/drupal7/admin/structure/views and clicked on "Add new view".
2. Added view name. from drop-down show selected "profile" and of type selected "creative" as this an profile type created by me.
3. Now from "Display Fromat" selected "Unformatted list" of"fields".
4. checked checkbox "create a block". Under that selected the same setting as in step 3.
5. click continue & Edit.
6. Under fields section added custom profile fields which was created in "creative" profile.
(P.N. : No need to add relationships.)
7. Finally save the view and visit the page create, you will be able to see the profile listing.

Hope it helps :)

Polyspiral’s picture

Works now, turned out my site was running out of memory, switched servers and its fine

thanks for all you help xxx

aresgod112’s picture

Thank you for making this topic , I thought i'd never find this autoassignroles