Fix enotice when using Civi-import #25979
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fix enotice when using Civi-import
Before
When Civi-import is enabled and the there is an attempt to save an import configuration which includes Soft Credit fields e-notices appear and the Soft credit fields are not saved to
civicrm_mapping_field
. This is actually a cosmetic rather than functional issue as the values incivicrm_mapping_field
and not the primary information source for mappings when Civi-Import is enabled. They are synced to the primary source - which is theimport_mappings
key in thecivicrm_user_job.metadata
field. We don't necessary want to keep this sync forever - but while it exists it should work....After
E-notices fixed, it saves
Technical Details
The underlying problem we are hacking around is that we use api syntax (with dots between entity & field names) with the import code but the QuickForm hierarchical Select element does not support the dots (which I think break it's js). On the QuickForm layer we swap them out for
__
& then back again but on the angular layer we keep the dots & save the values to the more sophisticated data structure in the metadataComments
Not new to this PR but I do wonder if my js structure here and here is at risk of Quickform submit starting before the js has saved the job. Recommendations welcome on it