Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey! Thanks for this lifesaver.
I'd really love to be able to Sort the view by the number of references a node has. Is that already possible?
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedI do not see how this feature is related to this particular module. This is probably something to explore with Views GroupBy module, or another module that could provide such a feature.
PS: As a f.r. this would be "won't fix", but then the issue is not visible in default issues queue view. So, I'm switching to s.r. and marking it as fixed.
Comment #2
entendu CreditAttribution: entendu commentedI may not have explained myself well.
Consider the following scenario: You have two node types, Questions and Answers. Answers reference the Questions they answer. You want to create a view of Most Answered Questions.
Since your view needs to output the Question node title, you use this module to create a relationship, and under filters in the view, filter on reverse nodereference > 0.
However, you cannot SORT by the # of nodereferences. That's what I'm looking to do, and this seems like the natural place to do it.
Comment #3
markus_petrux CreditAttribution: markus_petrux commentedOk, so this is clearly a "feature request", so it ends up as "won't fix", or it could also be "by design".
To sort in Views, we use sort handlers. This is not related at all with this module. This module implements a Views relationship handler. That's the scope of this module.
If you need to sort by something that's not covered in Views, then you need to develop a sort handler. That's out of the scope of this module.
Comment #4
entendu CreditAttribution: entendu commentedFor anyone else looking to do the same, I solved it with hook_views_query_alter():