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] Extract transferParticipantRegistration function #16976

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Apr 4, 2020

Overview

This is the extraction portion of #16956

On testing that I hit an error but getting the extraction merged first should make it easier
to review future iterations as it will reduce noise in the code.

Before

One long function

After

transferParticipantRegistration extracted

Technical Details

Note I made the function non-static since it is still on the form & passed in
event ID since we have it but it's otherwise pretty much the same as the
extraction part of that PR

Comments

This is the extraction portion of civicrm#16956

On testing that I hit  an error but getting the extraction merged first should make it easierr
to review future iterations as it  will reduce noise in the code.

Note I made the  function non-static since it is still on the form & passed in
event ID since we have it but it's otherwise pretty much the same as the
extraction part of that PR
@civibot
Copy link

civibot bot commented Apr 4, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

test this please

$params = [1 => [$fromParticipantID, 'Integer']];
$dao = CRM_Core_DAO::executeQuery($query, $params);
//copy line items to new participant
$line_items = CRM_Price_BAO_LineItem::getLineItems($this->_from_participant_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

weird to see the test included in this PR is passing without failure as I wrote it to assert the incorrect line items attached to the previous contribution id. On checking, it seems the test passes because the above variable $this->_from_participant_id arrives as empty while it is executed.

Shouldn't it be set to the function parameter $fromParticipantID so that it is also verified in testing process? Or else as this function isn't static anymore, I think we might need to update the test to have a value for $form-> _from_participant_id before calling this function. We might also need to remove the unnecessary params included in this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jitendrapurohit the test can be fixed to fail when we add the fix to fix :-)

@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit I will merge this as a reviewer commit if you are OK with it - per comments above we can break the tests in the next round :-)

@jitendrapurohit
Copy link
Contributor

yes, sure. since this isn't breaking anything from UI side, I'm happy to cover the test part in another PR. Pls merge so I can update mine :)

@eileenmcnaughton eileenmcnaughton merged commit ddf1be1 into civicrm:master Apr 9, 2020
@eileenmcnaughton eileenmcnaughton deleted the xfer branch April 9, 2020 02:42
@eileenmcnaughton
Copy link
Contributor Author

Done! - Make sure you check yours on non-text fields cos they failed for me

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