Hi everyone

I've just upgraded to the latest version of Drupal and Views, which have given me a small problem. The user profile fields are not to be chosen within a node view anymore.

As an example of the use for this possibility is the attachment of the users full name to a blog entry, instead of just the username. The username and other user attributes are availible from the list.

Best regards

Henrik

CommentFileSizeAuthor
#5 snapshot26.png74.86 KBdawehner

Comments

bojanz’s picture

Are those the profile.module fields, or Field API fields attached to the user entity?

I'm guessing profile.module, which is pretty much dead in D7 (you only see the actual module if you've upgraded...)

thorn’s picture

It's the Field API attached to the user entity. I've noticed that the profile.module has been replaced with the fields, which seems to be the logical way to do it. However, it would be nice it views then supported the other way.

bojanz’s picture

I believe Views still has some support for the old profile fields, but I have no idea how stable it is, or if it's even working.

As for Field API fields on the user entity, please try the patch at #1006644: Fields cannot be set in user views, see if it fixes your issue
If not, we'll debug it.

thorn’s picture

Hi Bojanz

I've just applied the patch without any luck.

If you can push me into a direction I would be more than glad to help debug.

dawehner’s picture

StatusFileSize
new74.86 KB

Please share some ways/steps to reproduce the problem.

It's working fine here, both on node and user views.

bojanz’s picture

Status: Active » Postponed (maintainer needs more info)

So...

thorn’s picture

Sorry for the late response. I've been on holiday.

I've created some fields in admin/config/people/accounts/fields. Among these are:
fields_profile_name
fields_profile_mobile
fields_profile_titel

I would like to access them, when I create a view of the node type. I can see my other fields, which are created along with the content types, but my fields from the account/fields are missing. I've updated both Views and Drupal to the latest version without any improvements. It seems that Views simply doesn't pick up the profile group, as shown in the screenshot above.

Views are able to use the fields, since I can add a view of the type user and see the fields. I've tried in both Chrome, Chromium and Firefox without a solution.

bojanz’s picture

Assigned: Unassigned » dawehner
Status: Postponed (maintainer needs more info) » Active

Confirmed the bug.
Assigning to dereine, as agreed on.

tebb’s picture

Should the name of this issue be changed as these are fields on the user entity aren't they?

(I was looking for using Profile2 fields with views, but I guess this isn't possible?)

bojanz’s picture

It should be possible, but we currently seem to have an issue with pulling any fields from a relationship..

hadsie’s picture

subscribing...

merlinofchaos’s picture

Try adding the Node: Author relationship.

smilterman’s picture

Hi,

I don't know if this is the right issue to ask about my problem but it's the only one I found where sombody is asking the same question as I am about to. So sorry if this isn't the right place.

Like "thorn" in #7, I am having the following problem:

I'm using Drupal 7.
I created a custom field in the account settings.
Now, I want to be able to add this field to my views, but when I go to my view and I want to add a field, under users, there are only the standard options to choose from and not the custom user field I added.
Can a custom field like this be added in my view some other way?

I hope this is a bit clear because I don't really know how to put it otherwise.

Thnx for all the help.

Grtzzz

bojanz’s picture

Should work. Are you using the latest Views dev release?

bojanz’s picture

Status: Active » Closed (works as designed)

I confirmed that this works.

1) Added a field in Account settings
2) Added a view with "Users" as the base table
3) Found the field under Fields

Confirm #3 (it's under "Fields" not under "Users")

smilterman’s picture

Hey bojanz,

thnx for the reply, what do you mean by "Added a view with "Users" as the base table"?
I have my view all setup, fiddeled around with everything, but still can't find the field I added in my account settings.

Thnx again

-----------------------------------------

"edit"

ok, I spoke too soon, created a new "user" view and now I see the field.

Thnx

chi’s picture

Title: Profile fields not included in field-list » Profile fields not included in field-list in view of the node type
Status: Closed (works as designed) » Active

Hi bojanz.
Can you explain, what do you mean by "Added a view with "Users" as the base table"?
I've installed the latest version of Drupal and Views and I've reproduced steps like thorn in #7.
It doesn't works. It works only in view of user type.

bojanz’s picture

Status: Active » Closed (works as designed)

When adding a view, I selected Show: Users from the dropdown.

merlinofchaos’s picture

Status: Closed (works as designed) » Fixed

User type == "Users" as base table

The former is UI language and the latter is internals language.

I suggested in #12 that you add the Node: Author relationship. In D7 that's actually Content: Author, now.

I haven't seen any text that you've tried this suggestion, but I'm 100% sure it will work.

chi’s picture

Thanks, I writed #17 too soon. I've added "Author relationship".
It works fine.

Status: Fixed » Closed (fixed)

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

manu.joseph’s picture

Thankz merlinofchaos, as u told i have created a new view by Add New View and select Users from Show drop down and was able to get ma user fields newly added to registration pages.

jenifertucker’s picture

Title: Profile fields not included in field-list in view of the node type » Profile fields not displayed in panels

I too had a similar problem upgrading from Drupal 6 to Drupal 7 having not known that the core Profile module has been/will be deprecated.

My site uses Panels and the blog section displays information about the blogger alongside.

Here's my notes if they are useful to anyone trying to fathom this out for themselves -

# Profile module has been deprecated as of Drupal 7 but still accessible.
# http://drupal.org/node/1008870
# However views using profile fields are broken.
# Panel for node view (blog) broken.

# This view has been automatically updated to fix missing relationships.
# While this View should continue to work, you should verify that the
# automatic updates are correct and save this view.
http://www.example.com/admin/structure/views/view/Blogger/edit

# Add new fields to 'people' account settings.
http://www.example.com/admin/config/people/accounts/fields

Label: About my Blog
Machine name: my_blog
Field type: text

Label: Blog URL
Machine name: blog_url
Field type: text

# Delete old 'blogger' view.
http://www.example.com/admin/structure/views/view/Blogger/delete

# Create replacement 'blogger' view.
http://www.example.com/admin/structure/views/add

View name: Blogger
Show: Users
Disable: Create a page
Enable: Create a block
Block title: About this blog
Display format: Unfortmatted list of 'Panel fields'
(Advanced) Contextual filters
Content: Content Nid
Relationships
User: Content authored
Fields
User: about_blogger
User: blog_link

# Delete old 'blogger' block from panel view.
http://www.example.com/k/admin/structure/pages/nojs/operation/node_view/...

# Add new 'blogger' view to content pane.

Edit settings:

Choose which context and how you would like it converted.
Content: Nid > Content ID

# Check blog display.
http://www.example.com/blog/5689