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

Extract code for getting additional return properties, test #12505

Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Extract code for getting additional return properties, test

Before

Code jumbled

After

Code less jumbled

Technical Details

@jitendrapurohit this should address the re-ordering issue you spotted.

Comments

Anything else you would like the reviewer to note

@civibot
Copy link

civibot bot commented Jul 18, 2018

(Standard links)

@jitendrapurohit
Copy link
Contributor

@eileenmcnaughton There is a related warning about the return statement removal in Activity.php file.

@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit ug. Actually I have a couple more commits locally. I might add them in. It will be more change so harder to review but less testing overall - you prefer I add before you review? I've extracted more of the getReturnProperties & added more tests

@jitendrapurohit
Copy link
Contributor

hmm, yes, would like to review it as a whole 👍

@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit OK - I'm gonna be chipping away for a while - but I'll grow this PR a bit

@eileenmcnaughton eileenmcnaughton force-pushed the export_fix_return_order branch 3 times, most recently from 01335b4 to a2cf7b1 Compare July 18, 2018 13:52
@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit I added some more commits. It looks like a lot of code change now but each commit should be self-contained.

This feels like a sensible 'set' because all the changes relate to setting $returnProperties when $fields is NULL (ie. export 'Primary fields') rather than specifying the output fields

@eileenmcnaughton
Copy link
Contributor Author

In my defence - there are 430 extra test lines - the score is not fair

@eileenmcnaughton eileenmcnaughton force-pushed the export_fix_return_order branch 2 times, most recently from 9744247 to 97bb8d1 Compare July 19, 2018 10:26
@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit I added two more commits - but it's 600 lines of unit tests & 3 lines of code removal

da6faba - to fix an enotice blocking the test - pretty sure the removal would not have a negative impact & the 'case' var would never be set as the $queryFields comes from the query object & is very standard

@jitendrapurohit
Copy link
Contributor

@eileenmcnaughton Tested on all the export components, contacts, membership, activities, cases, etc and the functionality looks correct. Also tested by inserting some debug statements and checked the values of different variables($returnProperties, etc) before and after the changes and they seem fine in all cases. Can conclude that this is safe to be merged 👍

@eileenmcnaughton
Copy link
Contributor Author

Added merge on pass based on @jitendrapurohit testing - thanks heaps!

Just rebased it so will check tests before merging

@eileenmcnaughton eileenmcnaughton merged commit f4fe271 into civicrm:master Jul 21, 2018
@eileenmcnaughton eileenmcnaughton deleted the export_fix_return_order branch July 21, 2018 00:34
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.

3 participants