Should this module work with multivalue fields?

Created on 19 August 2020, over 4 years ago
Updated 23 October 2023, over 1 year ago

I tried this module out, but I needed to sort on the basis of a multi-value field (and hence array) being empty. It didn't work at all, so I'm presuming it doesn't support arrays, which is cool. I thought I'd just report it anyway in case you thought it would.

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.0

Component

Documentation

Created by

πŸ‡³πŸ‡ΏNew Zealand thomasmurphy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck Texas, USA πŸ‡ΊπŸ‡Έ

    Hey there @thomasmurphy,

    So sorting on multivalue fields as a whole doesn't work like this. Adding any kind of sort breaks the rows down into their individual results reguardless of what you have in the "Fields" section of the view...

    For example, you might have this:

    But as soon as you add a sort clause on a field with multiple cardinality, you get result rows for each value represented in that field. I've got the query turned on so you can see how adding a sort changes the query.

    The multiple field thing only works because the field handler for fields have that special ability, So core itself doesn't even have the ability to sort those multivalue fields

    All that said, if you use the views_sort_null, you can make that one item appear at the top and the bottom... Additionally, you can use aggregation to narrow the results down to just the nids you want... So something like this... (note you can use this method for other types of sorts too.

    So I don't think this is a views_sort_null_field specific issue, but we can totally throw hints out there.

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States generalredneck Texas, USA πŸ‡ΊπŸ‡Έ
Production build 0.71.5 2024