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

remove duplicated call to createCreditNoteId() #13509

Merged
merged 1 commit into from
Jan 29, 2019

Conversation

sluc23
Copy link
Contributor

@sluc23 sluc23 commented Jan 29, 2019

Overview

Remove duplicated call to CRM_Contribute_BAO_Contribution::createCreditNoteId() in CRM_Contribute_BAO_Contribution::create() method

Before

In create() method the function createCreditNoteId() is called if the Contribution to be created has status Canceled or Refunded
Then add() is called which does the exact same call

After

Only add() performs the createCreditNoteId() call

Technical Details

The exact same code is executed twice when creating/editing a Contribution in Canceled or Refunded. Removing the one in create() method

Note extended discussion in chat at https://chat.civicrm.org/civicrm/pl/7ybsucbd1tr7bdftmb94atj6mh

@civibot
Copy link

civibot bot commented Jan 29, 2019

(Standard links)

@civibot civibot bot added the master label Jan 29, 2019
@sluc23 sluc23 changed the title remove duplicate call to createCreditNoteId() remove duplicated call to createCreditNoteId() Jan 29, 2019
@sluc23
Copy link
Contributor Author

sluc23 commented Jan 29, 2019

@monishdeb

@monishdeb
Copy link
Member

@sluc23 nice catch. Tested and confirmed that patch safely removes the duplicate code and theres no unwanted side-effect. Marking with Merge on pass

@monishdeb monishdeb merged commit b639ca8 into civicrm:master Jan 29, 2019
@sluc23 sluc23 deleted the dev-duplicateCreateCreditNote branch January 30, 2019 17:26
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