Improve aggregation handling and fix other bugs

Created on 1 May 2019, over 5 years ago
Updated 9 September 2024, 2 months ago

With SUM and COUNT the value of the field is lost. The SQL shows:

SUM(raw_sql_field) AS raw_sql_field,

The error is the following:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'raw_sql_field' in 'field list'

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kenton.r

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States bwong

    I have not put a diff file together to fix this but I did figure out what is going on. Essentially the system automatically switches to a NumericField. This needs to be prevented. The trick is to keep track of the aggregation within the module and prevent the system from overriding and using the NumericField. It is then up to this module to provide that selection and to implement the selected aggregation function when generating the query.

  • Assigned to bwong
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bwong

    This is almost a complete rewrite of the 8.x version. It works with Drupal versions 8 through 10. It includes support for fields, filters, sorts, and arguments. It adds token replacement and works with aggregation. A full version is include in case you don't want to contend with the patch. If the patch is acceptable I recommend that it be marked as version 1.0.

  • First commit to issue fork.
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @bwong the patch looks nice and I just wanted to create a MR on it, but it seems messed up. Looks like it was created based on the module in a subfolder.

    Could you create the MR please or fix the patch? Would be nice to merge!

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Status changed to Needs work 2 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Merge request !3Applied patch β†’ (Merged) created by Anybody
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    I was finally able to apply the patch by recreating the folder structure used.

  • Assigned to Anybody
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Issue was unassigned.
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Okay the MR based on the patches is ready and fixes several issues plus aggregation compatibility.

    Changing the %argument% placeholder to [argument] is a breaking change, so this will need a new major release and at least an update hook to inform the users.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @Grevil can you please implement the informing update hook by time, just to let people know %argument% placeholder changed to [argument] token and people may need to update their views, if they used it?

    The module is alpha so it doesn't need automatical resolution and we'll merge this into a new branch 2.x (BC ok)

    Afterwards we should merge this, as it fixes many bugs.

  • Assigned to Grevil
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • First commit to issue fork.
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    Done:

    Furthermore, I did some minor adjustments. LGTM! Please have a final look @anybody.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Pipeline finished with Skipped
    2 months ago
    #277846
  • Status changed to RTBC 2 months ago
    • anybody β†’ committed 292b61ae on 2.x
      Issue #3051961 by anybody, grevil: Improve aggregation handling and fix...
  • Status changed to Fixed 2 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024