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] Minor code simplification - extract getHighlightedFields in Contribution import MapField #25866

Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 18, 2023

Overview

[REF] Minor code simplification - extract getHighlightedFields in Contribution import MapField

Before

The MapField preProcess does 2 things

  1. calls the parent
  2. assigns 'highlightedFields'

The parent calls assignMapFieldVariables
image

which assigns highlightedFields based on the output of getHighlightedFields

image

As there is currently no function for this on Contribution_Import_Form_MapField the parent getHighlightedFields is called. It returns an empty array - which is overwritten in Contribution_Import_Form_MapField::preProcess

After

We extract the code to getHighlightedFields so the parent can assign it. No more need for the preProcess override - but the fields are still highlighted

image

Technical Details

Minor cleanup

Comments

@civibot
Copy link

civibot bot commented Mar 18, 2023

(Standard links)

@civibot civibot bot added the master label Mar 18, 2023
@colemanw colemanw merged commit 16d780b into civicrm:master Mar 19, 2023
@colemanw colemanw deleted the import_contribution_mapfield branch March 19, 2023 14:39
@colemanw
Copy link
Member

Oh what a tangled web!

@eileenmcnaughton
Copy link
Contributor Author

@colemanw yeah good point - we can untangle it a bit #25869

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