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

Switch to using apiv4 for metadata #21038

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Aug 6, 2021

Overview

Switch to using apiv4 for metadata - follow up to #21036 which moves some of this stuff to a (potentially temporary) class

Before

Uses BAO metadata

After

Uses apiv4 metadata

Technical Details

I've manually skipped currency for now - which will make this no-change

Comments

@civibot
Copy link

civibot bot commented Aug 6, 2021

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 this should be a no-change patch that improves readability / switches to apiv4 metadata & has good test cover by now

public function getBAOName(): string {
return CRM_Core_DAO_AllCoreTables::getFullName(ucfirst($this->getEntityName()));
protected function getApiEntityName(): string {
return 'Contribution';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but why is getEntityName returning a lower-case string in the first place? To be clear, 'contribution' is not the entity name; the correct answer is 'Contribution', Alex.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the delicacy of not wanting to break things, but IMO it's already broken if it's returning an incorrect string. 'Contribution' isn't just the API entity name, it's the canonical entity name per CRM_Core_DAO_AllCoreTables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw yeah - I might revisit that - but I'd rather not do it in this PR as I'm not comfortable yet about whether it will have a negative impact

@colemanw colemanw merged commit 60738cf into civicrm:master Aug 6, 2021
@colemanw colemanw deleted the tok_names branch August 6, 2021 14:51
@colemanw
Copy link
Member

colemanw commented Aug 6, 2021

Ok the entity name can be addressed in a followup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants