Download & Extend

Sorting list of relationshipped user with views

Project:User Relationships
Version:6.x-1.0-rc2
Component:Code
Category:feature request
Priority:normal
Assigned:alex.k
Status:closed (fixed)

Issue Summary

Hello,

I am creating a small block that shows the list of friends the logged in user. The fields I am using are:

- (requestee) User: Name
- User relationships: Updated date

I am trying to make a sort on the User relationships: Updated date in order to show the latest friends that where added in the relationship list.

The problem is that the User relationships: Updated date does not appear in the list of field of the sort option.

Any hint?

Thanks.

Comments

#1

Here is the exported view. Maybe someone wants to look inside?

AttachmentSizeStatusTest resultOperations
UR- sort with views.txt5.17 KBIgnored: Check issue status.NoneNone

#2

Hmm, in UR-Views it appears the field is specified as click sortable, so it should appear among sort options.

Is it sortable if you show your view as a table, and check the sort option in table display options?

#3

Hi Alex,

Yes, using the table layout could be a kind of workaround since it is possible to determine the sort order to the column and have it preset.

But for design purposes, I need to use the HTML list option ... . Any idea on how I could achieve this?

Thanks, Yoel

#4

I'm pretty sure it is an easy fix in the way the field is declared to Views. After all, it's inherently sortable, and uses the same display/filter bits as other core date elements.

#5

Component:Miscellaneous» Code
Category:support request» feature request
Assigned to:Anonymous» alex.k
Status:active» fixed

Committed a fix for this in http://drupal.org/cvs?commit=279834. You will need to clear views cache in admin/build/views/tools. Attaching a test view that takes advantage of sorting. Please post back with results, hope it works.

AttachmentSizeStatusTest resultOperations
610500-sortable-ur-view.txt4.41 KBIgnored: Check issue status.NoneNone

#6

Hi Alex,

I have imported your view for testing.

In the sort section, I get an error: Error: handler for user_relationships > created_at doesn't exist!

It is logical in my case since the only available field for UR in the sort section is: User relationships: RTID

Any idea? Thanks.

#7

@yoeld have you upgraded to today's -dev release? You need to do that and run through update.php for this to work.

#8

Ooops! Sorry ... .

#9

Hi Alex,

I installed the latest dev version and run the update.php.

Still no change. I have added the picture of the view, just for your information.

Any suggestion? MANY thanks!

AttachmentSizeStatusTest resultOperations
UR-sort-1.png11.17 KBIgnored: Check issue status.NoneNone

#10

I still cannot reproduce even after a complete uninstall and reinstall of UR. Some code must be missing in your installation. Specifically, in user_relationship_views/user_relationship_views.views.inc you should be seeing this snippet twice:

<?php
     
'sort' => array(
       
'handler' => 'views_handler_sort_date',
      ),
?>

[EDIT] make sure you are running the latest Views, too.

#11

Hi Alex,

[EDIT] make sure you are running the latest Views, too.

That's what made the difference. It is now working perfectly.

Thanks for helping!

#12

Status:fixed» closed (fixed)

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

nobody click here