Skip to content
Snippets Groups Projects
Commit 54ed517e authored by eileen's avatar eileen
Browse files

Move the qfbug handling to it's own function

This is a really toxi function. In order to save the pain or iterating multiple times through a small array
we are dealing with an awful lot of complexity. I'm changing this to iterate through it multiple
times in order to rationalise the code - I think performance is minimal & being able to read the code....
parent b632d5ee
Branches
Tags
No related merge requests found
......@@ -1609,14 +1609,11 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
return FALSE;
}
$qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9';
$relTables = CRM_Dedupe_Merger::relTables();
$submittedCustomFields = $moveTables = $locationMigrationInfo = $tableOperations = $removeTables = [];
self::swapOutFieldsAffectedByQFZeroBug($migrationInfo);
foreach ($migrationInfo as $key => $value) {
if ($value == $qfZeroBug) {
$value = '0';
}
if (substr($key, 0, 12) == 'move_custom_' && $value != NULL) {
$submitted[substr($key, 5)] = $value;
......@@ -2408,4 +2405,23 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
}
}
/**
* Replace the pseudo QFKey with zero if it is present.
*
* @todo - on the slim chance this is still relevant it should be moved to the form layer.
*
* Details about this bug are somewhat obscured by the move from svn but perhaps JIRA
* can still help.
*
* @param array $migrationInfo
*/
protected static function swapOutFieldsAffectedByQFZeroBug(&$migrationInfo) {
$qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9';
foreach ($migrationInfo as $key => &$value) {
if ($value == $qfZeroBug) {
$value = '0';
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment