Upgrading from 10.4.5 to 10.4.6 removes views format plural on Content ID field

Created on 8 April 2025, 18 days ago

Problem/Motivation

After upgrading from 10.4.5 to 10.4.6, a view that previously showed the "Format Plural" option, allowing to set singular and plural forms using "@count" has disappeared. Then, instead of "@count items" it displays one of the content IDs.

Steps to reproduce

  • Using drupal 10.4.5 do the following:
  • Content type cT_A
  • Content type cT_B: with a reference field (field_ref_ct_a) to cT_A, multiple values.
  • Create one instance of cT_A (cT_A_instance_one)
  • Create 3 instances of cT_B referencing the cT_A_instance_one
  • Create a view listing nodes of type cT_A
    • show Fields
    • Enable aggregation under "Advanced>Other".
    • Add a relationship "Relate each Content with a field_ref_ct_a set to the content item."
    • Add the a field "Content: ID" using the relationship.
    • Set field aggregation to "Count DISTINCT"
    • Open field settings, This field provides the "Format plural" checkbox. Enable it and set "1 item" under "singular form", and "@count items" under "Plural form" the
    • Save the view. The view will show the title and the total number of nodes of type cT_B referencing each cT_A. So it should show cT_A_instance_one with 3 items.
  • Update Drupal to 10.4.6
  • revisit the view, it shows a content id instead of the count.
  • go to views configuration, the Format Plural is no longer there.

Proposed resolution

It is be related to this commit that changes the views SQL and removes the "field: numeric" from the getAggregationInfo(): https://git.drupalcode.org/project/drupal/-/commit/59d79456a1a135b3d02bb...

I'm not sure if this was removed on purpose and if there is any other recommended way to accomplish the same "@count" behavior with drupal 10.4.6.
By adding back the 'field' => 'numeric', the view works as expected again

🐛 Bug report
Status

Active

Version

10.4

Component

views.module

Created by

🇪🇸Spain espurnes

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

Comments & Activities

Production build 0.71.5 2024