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

dev/core#1001 Fix count notice warnings in php 7.2 [Import] #14989

Merged
merged 2 commits into from
Aug 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions CRM/Contribute/Import/Parser.php
Original file line number Diff line number Diff line change
@@ -427,20 +427,34 @@ public function setActiveFields($fieldKeys) {
}

/**
* Store the soft credit field information.
*
* This was perhaps done this way on the believe that a lot of code pain
* was worth it to avoid negligible-cost array iterations. Perhaps we could prioritise
* readability & maintainability next since we can just work with functions to retrieve
* data from the metadata.
*
* @param array $elements
*/
public function setActiveFieldSoftCredit($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_softCreditField = $elements[$i];
foreach ((array) $elements as $i => $element) {
$this->_activeFields[$i]->_softCreditField = $element;
}
}

/**
* Store the soft credit field type information.
*
* This was perhaps done this way on the believe that a lot of code pain
* was worth it to avoid negligible-cost array iterations. Perhaps we could prioritise
* readability & maintainability next since we can just work with functions to retrieve
* data from the metadata.
*
* @param array $elements
*/
public function setActiveFieldSoftCreditType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_softCreditType = $elements[$i];
foreach ((array) $elements as $i => $element) {
$this->_activeFields[$i]->_softCreditType = $element;
}
}

Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ public function testContributionStatusLabel() {
* @param array|null $fields
* Array of field names. Will be calculated from $originalValues if not passed in.
*/
protected function runImport($originalValues, $onDuplicateAction, $expectedResult, $mapperSoftCredit = [], $mapperPhoneType = NULL, $mapperSoftCreditType = [], $fields = NULL) {
protected function runImport($originalValues, $onDuplicateAction, $expectedResult, $mapperSoftCredit = NULL, $mapperPhoneType = NULL, $mapperSoftCreditType = NULL, $fields = NULL) {
if (!$fields) {
$fields = array_keys($originalValues);
}