Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DAO fields more consistent #14072

Merged
merged 2 commits into from
Apr 17, 2019
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Currently the 'where' field is only populated when 'import' or 'export' is TRUE. This is part of why we have such an overloading of import & export. The BAO_Query class generally loads & handles metadata for fields where import is true. I believe this evolved by people trying to use what was there rather than made sense at any point in time.

I think that we can move towards simplifying some of our metadata based magic by trying to get the meaning of import & export closer to the original intent.

This PR makes is so the 'where' field is populated regardless of whether import or export is set. (A case could be made that it's easily calculable but there are places in the code that use it so better for it to be consistent for now IMHO).

Before

Where key only present when import or export = true

After

Where key present for all fields

Technical Details

I also added code so headerPattern & dataPattern display depended on not being empty rather than import / export. I would be just as happy with 'always set, even if empty'

This is the actual tpl change
bf144e7

The 'schema::' change is formatting compliance

Comments

…dd 'where' param

Import & export have been hopelessly overloaded & misued in the code. One reason is that without them
'where' is not present. Logically import & export should have a narrow usage and should not
be a pre-requisite for being available as a search field, in reality not so much.

This simply makes the 'where' field available regardless of the presence of these fields

By doing this we can make the metadata in the Query object able to handle more fields
without special handling (e.g Contribution Recur fields)
@civibot
Copy link

civibot bot commented Apr 16, 2019

(Standard links)

@civibot civibot bot added the master label Apr 16, 2019
@seamuslee001
Copy link
Contributor

This seems sensible to me adding merge on pass

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

Merging

@seamuslee001 seamuslee001 merged commit a87433f into civicrm:master Apr 17, 2019
@seamuslee001 seamuslee001 deleted the dao branch April 17, 2019 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants