- πΊπΈUnited States BDuell
Any luck on this @BenStallings ?
Thank you!
- πΊπΈUnited States BenStallings
@BDuell, honestly I don't remember what I wound up doing with that. :S
It looks like maybe this scratched my itch: https://www.drupal.org/node/3300819 β - π¨π¦Canada plousia
I'm having the same issue and wonder if this is getting any attention? It seems like a common use case and a pretty needed functionality.
I have a site with "programs" with recurring dates. I have to be able to display only the next instance of the date, and sort the view on that. The patch in the issue linked in #11 does allow you to output the next instance in a view, but not to sort by it (unless I'm missing something).
- π¨π¦Canada mandclu
From everything I've read, Solr is unable to properly sort on a multivalued field. That is not a limitation of Smart Date, nor is it something this module will be able to fix. Unless someone has a better solution, I would suggest that the only solution is to not use Solr if you want to sort on multivalued (e.g. recurring) dates.
- π¨π¦Canada plousia
Maybe this isn't the issue I should have posted in; I'm just looking to sort in a regular view, not Solr. Is that possible?
- π¨π¦Canada mandclu
@plousia yes, the Smart Date Starter Kit includes a view that works this way out of the box. The upcoming events display should be pretty close to what you want, especially if you set it to use the recurring formatter.
- π¨π¦Canada plousia
Thanks. I can't install Smart Date Starter Kit because I already have a content type called "event". But looking at the YML for the view that comes with it, the sorts for the upcoming display are like this:
sorts: field_when_value: id: field_when_value table: node__field_when field: field_when_value relationship: none group_type: min admin_label: '' plugin_id: '1' order: ASC expose: label: '' field_identifier: field_when_value exposed: false granularity: second
This is the sorts YML for my view, which looks pretty identical, but it's still not sorting by next upcoming date:
sorts: field_event_dates_value: id: field_event_dates_value table: node__field_event_dates field: field_event_dates_value relationship: none group_type: min admin_label: '' plugin_id: date order: ASC expose: label: '' field_identifier: '' exposed: false granularity: second
Happy to provide any more information that might be needed to diagnose the issue.
- π¨π¦Canada mandclu
Do you have your view filtered to only show upcoming dates?
- π¨π¦Canada plousia
Figured out what the issue was, in case this may help someone else. My view has aggregation turned on, and the aggregation setting for the "date field > now" filter was set to MIN. Changing it back to the default "group results together" fixed the problem and the events are now sorting according to upcoming date.
I found another weird issue, though. If you set a Smart Date recurring field to "ends on" a specific date, rather "ends after" a certain number of instances, that content doesn't sort properly with content with the date field recurrence set to "ends after". That doesn't seem like the expected behaviour.
- Status changed to Closed: works as designed
about 1 year ago 12:39pm 5 December 2023 - π¨π¦Canada mandclu
I've come to the conclusion that reported behaviour here is really a limitation of Solr and as such not something that Smart Date would be able to address. Feel free to reopen if someone identifies a way.