Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 932
    • Issues 932
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • Core
  • Issues
  • #1054

Closed
Open
Opened Jun 18, 2019 by francescbassas@francescbassas

Several CiviContribute fields cause an error in Search Builder

Recently I was trying to do a search with Search Builder including soft credits clauses and I was not able to. Instead I got an error. I found the issue related reported by Guillaume Boudrias on the old issue tracker https://issues.civicrm.org/jira/browse/CRM-20587 and I proceeded to reopened here.

Contribution fields that do not belong to the contribution table seem to cause an error when using the Search Builder.

Examples:

  • Contribution -> End date for Premiums
  • Contribution -> Soft Credit For
  • Contribution -> Batch Name

Simply using the fields results in an error page: "DB Error: no such field"

Sample error in debug mode:

Database Error Code: Unknown column 'civicrm_contribution.financial_type_id' in 'where clause', 1054

It seems we are missing a JOIN clause somewhere, though I don't know where in the code this is generated.

I assume the issue may be present with more than CiviContribute but I haven't found other problematic fields.

This issue can be reproduced on the demo sites such as http://dmaster.demo.civicrm.org

Steps to reproduce:

  1. Activate CiviContribute
  2. Go to Search Builder (civicrm/contact/search/builder)
  3. Select Contribution -> End date for premium -> Is not null
  4. Press search
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#1054