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

[Ref] cleanup alterActionSchedule #21047

Merged
merged 1 commit into from Aug 7, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

[Ref] cleanup alterActionSchedule

Before

More code

After

Less ... but since I pre-added really solid testing on this function we can be sure that a green light means it wasn't missed

Technical Details

We can simplify this function now as basicFields is keyed by the real field name and
all pseudofields are already in basicFields.

tests in testTokenRendering cover both pseudo & non pseudo fields

Comments

@civibot
Copy link

civibot bot commented Aug 6, 2021

(Standard links)

@civibot civibot bot added the master label Aug 6, 2021
We can simplify this function now as basicFields is keyed by the real field name and
all pseudofields are already in basicFields.
@eileenmcnaughton
Copy link
Contributor Author

@colemanw also this has good cover in testTokenRendering

foreach (array_keys($this->getPseudoTokens()) as $token) {
$split = explode(':', $token);
$e->query->select('e.' . $fields[$split[0]]['name'] . ' AS ' . $this->getEntityAlias() . $split[0]);
foreach ($this->getReturnFields() as $token) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton what has happened to the pseudo tokens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seamuslee001 yeah - it turned out I never needed them - (or perhaps I did before I got it sane) what I was doing was adding in the field they need - ie contribution_status_id - but since that field is ALSO in getReturnFields 'under it's own name' - I don't need the spy-version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(the tests specifically cover these )

@seamuslee001
Copy link
Contributor

Tests should cover us here merging

@seamuslee001 seamuslee001 merged commit 248f0a2 into civicrm:master Aug 7, 2021
@seamuslee001 seamuslee001 deleted the tok_return branch August 7, 2021 05:01
@eileenmcnaughton
Copy link
Contributor Author

thanks @seamuslee001 !

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