Thanks for a marvelous module. Recent patch to make parent and weight available as filters is much appreciated. #853286: Filter by draggableviews weight & parent

Another feature request in the same direction, would be to make them available as argument handlers (contextual filters) too. This would give the posibility to show children to the current node - if hierarchy is used. (Parent ID = node ID).

CommentFileSizeAuthor
#2 views_argument_handler-1913372-1.patch1.12 KBbecw

Comments

mazaza’s picture

Issue summary: View changes

Changed markup for issue reference

istryker’s picture

Problem #1: Getting the SQL to work properly.

I will not go into great detail of this problem as this is related to #1877662: Allow for different sort per user as they are trying to add an argument. In #1877662 case, its the uid.

Problem #2: Parent argument will only work for Native if we fix #1906454: Change Native Handler organization to how Taxonomy does it.

Say you had parent arguments working...currently, after you resave it will break everything.

I will illustrate it for everyone:

Say you have this little, without a weight/parent argument filter.

A 0:0
   B  1:A
   C  2:A
D 3:0
   E 4:D
      F 5:E
   G 6:D

Now let say you have an weight argument D and it produces:

D 3:0
   E 4:D
      F 5:E
   G 6:D

Say you move some things around

D 0:0
   G 1:D
      F 2:G
   E 3:D

It would get save like this

A 0:0
   B  1:A
   C  2:A
D 0:0
   G 1:D
      F 2:G
   E 3:D

It will actually get displayed like

A 0:0
D 0:0
   B 1:A
   G 1:D
   C  2:A
      F 2:G
   E 3:D

See #1906454: Change Native Handler organization to how Taxonomy does it for more illustrations

Problem #3: Do you display the root/parent or not?

Now let say you have an weight argument D and #1906454 is working. It produces:

D 1:0
   E 0:D
      F 0:E
   G 1:D

if you reorder you get

D 0:0
   G 0:D
      F 0:G
   E 1:D

This now doesn't work becaus D now has a weight of 0. If remove D somehow you get
D 1:0

   E 0:D
      F 0:E
   G 1:D

if you reorder you get
D 1:0

   G 0:0
      F 0:G
   E 1:0

Now the parents do not line up, and the view/order is broken.

Yes you probably can do some validation too fix it display with or without the root/parent, but now things are extremely more complicated.

istryker’s picture

Issue summary: View changes

Markup

becw’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.12 KB

This issue is pretty old, and comment #1 seems to no longer be relevant as of 7.x-2.x. However, the functionality would still be great to have! Here's a patch.

David_Rothstein’s picture

Status: Needs review » Reviewed & tested by the community

I've been using this patch for a little while and it works fine (I've been using the parent argument handler mainly, but I don't see why the weight one would be different).

I think some of the comments in #1 might be correct, but I don't think they're necessarily relevant for this issue in the sense that they don't seem like a problem that would be unique to the argument handler introduced here - wouldn't those concerns apply the same to the already-existing parent/weight filters also?