Move a little code from legacy function loadRelatedObjects
to the calling functions
#24190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
loadRelatedObjects
is a function we have been trying to decommission since the GFC. I'm pretty close to removing the call from the invoice task (which would leave two) but it interacts with_component
in weird ways - moving that interaction out ofloadRelatedObjects
& into the three places that call it creates opportunities for futher code cleanupBefore
The chunk of code that sets
_component
based on theinput
is inloadRelatedObjects
After
It is moved to the three calling functions. Two out of the three already call
find()
so I moved that line to the one that doesn't (or at least on a quick skim didn't appear to - I can look at the functions separately in more depth as we remove their shared dependenciesTechnical Details
@mattwire - another baby step - once we get rid of
loadRelatedObjects
out of theInvoice
task it will just remain intransitioncomponents
(itself on the hit list) andsendConfirmation
Comments