1

I have used the Profile module to create a date field on users profiles.

Now I want a view to list users filtering by that date field, but when I choose "Add filter criteria" in the Views UI, it does not list the date field. Fields of other types show up normally.

Is this a Views bug? How can I filter a view based on a date field from user profiles?

  • what type of view did you create(content, users, profile)? – Andrew Aug 5 '15 at 18:55
0

To create a view about Users, you start from admin/structure/views/add (of course).

However, below "Description" you need to select what type of data you want to "Show", and then optionally also select a "Type", etc).

By default (when you start creating a new view) it will suggest "Content" as value for "Show". But in your case you should have selected "Users" instead. If you do select "Users", you won't be able to select a "type" anymore. Because of the "... Fields of other types show up normally ..." in your question I assume you used the default (Content) instead of "Users".

That's possibly the reason why you can't select the user related fields either ... To resolve this, just create a new view about "Users".

  • I'm already using a view of users, and I can add filters for other types of fields of the user profile. I read somewhere that the problem with the date fields not appearing is a restriction because of the way profile stores the data. Thanks anyway. – drupalworker Aug 6 '15 at 12:26
0

Since the date is in a profile and not in the user, you view is going to have to use profile as your main content type and then join the content with user on the user ID field.

Be aware that the author of the profile2 module has stated that it might be better to add the fields to user rather than use the profile module. When the profile module was written user objects could not have additional fields added to them. This changed with the introduction of Drupal 7 and entities.

https://www.drupal.org/node/628280

  • How do I use profile as the content type in the view? I created a view of users, if I select "content type" when creating it, there's no "profile" option. Also, I'm not using profile2, the module name is just "Profile". – drupalworker Aug 6 '15 at 12:24
  • Unless you are using the depreciated Core Profile module which was primarily used in Drupal 6 and not Drupal 7 there is no "Profile" module only Profile2, see drupal.org/node/628280. – pacmaninbw Aug 6 '15 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.