Skip to content
Snippets Groups Projects
Unverified Commit 6259538a authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #24815 from seamuslee001/fix_campaign_id_import

[REF] Fix importing contributions with a campaign id rather than a t…
parents f6e5f337 a252e894
Branches
Tags
No related merge requests found
......@@ -1632,7 +1632,7 @@ abstract class CRM_Import_Parser implements UserJobInterface {
}
if ($fieldMetadata['name'] === 'campaign_id') {
if (!isset(Civi::$statics[__CLASS__][$fieldName][$importedValue])) {
$campaign = Campaign::get()->addClause('OR', ['title', '=', $importedValue], ['name', '=', $importedValue])->addSelect('id')->execute()->first();
$campaign = Campaign::get()->addClause('OR', ['title', '=', $importedValue], ['name', '=', $importedValue], ['id', '=', $importedValue])->addSelect('id')->execute()->first();
Civi::$statics[__CLASS__][$fieldName][$importedValue] = $campaign['id'] ?? FALSE;
}
return Civi::$statics[__CLASS__][$fieldName][$importedValue] ?? 'invalid_import_value';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment