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] Remove never-passed param from getLineItems #16251

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jan 9, 2020

Overview

Minor tidy up in getLineItems

Before

$invoice is in fn signature & has handling in fn but is never used

After

Parameter $invoice fully removed

Technical Details

Parameter was added to getLineItems in 25d0c64
to support invoicing. However that function no longer calls getLineItems & has not for some time (at least a year). No other functions
pass in this parameter so we can remove it_

Comments

The code comment suggests something might be broken here but it broke a long time ago & had no tests so at this stage we should clean it up & if comes back with tests then all good.

@civibot
Copy link

civibot bot commented Jan 9, 2020

(Standard links)

@civibot civibot bot added the master label Jan 9, 2020
Parameter  was added to getLineItems in civicrm@25d0c64
to support invoicing. However that function no longer calls getLineItems & has not for some time (at least a year). No other functions
pass in this parameter so we can remove it
@yashodha
Copy link
Contributor

yashodha commented Jan 9, 2020

@eileenmcnaughton Why is the additional participant bit removed as well?

@eileenmcnaughton
Copy link
Contributor Author

@yashodha because the if clause is

if ($entity == 'participant' && $invoice) {

If $invoice is never true the whole IF is never true

@mattwire mattwire merged commit 0f589a1 into civicrm:master Jan 9, 2020
@eileenmcnaughton eileenmcnaughton deleted the line_clean branch January 9, 2020 21:09
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.

3 participants