Answers.Body: <p>I have submitted a <a href="https://github.com/civicrm/civicrm-core/pull/16957" rel="nofollow noreferrer">PR</a> for this issue. Can you please try applying patch from <a href="https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/16957.patch" rel="nofollow noreferrer">here</a>?</p>
  
  <p>Thanks</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T14:04:56.540Z
Answers.Text: That's wicked - thanks Pradeep. This all seems to work now - I can save mappings and they populate automatically - will post back here if I see any issues.
  
  :D
Answers.UserDisplayName: Marsh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-03T17:57:11.363Z
Answers.Text: Thanks Pradeep!
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-09T07:45:56.770Z
Answers.Text: Can you mark this answered if it fixed your problem?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T12:43:37.967Z
Answers.LastActivityDate: 2020-04-02T12:43:37.967Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>As the title. 
  If I create custom field set against a contact subtype, then import fields from a csv (saving the mapping for later use), none of the mapped fields are saved for the custom fieldset.</p>
  
  <p>i.e.: on dmaster i can:</p>
  
  <ul>
  <li><p>create a new custom field set <strong>contact subtype custom fields</strong>:</p>
  
  <ul>
  <li>for use on individual > Volunteer</li>
  </ul></li>
  <li><p>add field: <strong>contact subtype field</strong></p></li>
  <li><p>find (or create) a volunteer, and enter something into the new custom field</p></li>
  <li><p>export the contact (select fields <strong>Contact_id</strong> &amp; <strong>contact subtype field</strong> (&amp; down load the file)</p></li>
  <li><p>import the file, mapping the fields correctly</p>
  
  <ul>
  <li>downloaded file</li>
  <li>update contacts</li>
  <li>contact type = individual > subtype: Volunteer</li>
  <li>continue</li>
  </ul></li>
  <li>set mapping to correctly map to the custom field <strong>contact subtype field</strong>
  
  <ul>
  <li>save mapping as... 'map 1'</li>
  <li>continue</li>
  </ul></li>
  <li>continue with import</li>
  <li>done</li>
  <li><p>change the <strong>contact subtype field</strong> label in the csv to <strong>foobar</strong></p></li>
  <li><p>import the csv - loading the saved mapping 'map 1'</p></li>
  </ul>
  
  <p>mapping does not load + notice is thrown up onscreen:</p>
  
  <pre><code>Notice: Undefined index: in CRM_Import_ImportProcessor-&gt;loadSavedMapping() (line 451 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Import/ImportProcessor.php).
  </code></pre>
  
  <p>anyone else suffer with this problem or have any ideas?</p>
  
  <p>there's an issue logged <a href="https://lab.civicrm.org/dev/core/issues/1662" rel="nofollow noreferrer">here</a> that has a fix, and is most likely related, but I'm not sure if this is a separate issue.</p>
  
  <p>Thanks in advance :) </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-02T12:37:56.163Z
Comments.Text: Thanks Marsh for reporting, I could replicated this on https://dmaster.demo.civicrm.org/ which is running on 5.25 tree.
Comments.UserDisplayName: Pradeep Nayak
Tags: <custom-fields><import><data-import><field-mapping>
Title: import mapping dont save for custom fields on contact subtypes
ThreadText: # import mapping dont save for custom fields on contact subtypes
  
  (Asked by: username_0 on 2020-04-02)
  
  As the title. 
  If I create custom field set against a contact subtype, then import fields from a csv (saving the mapping for later use), none of the mapped fields are saved for the custom fieldset.
  i.e.: on dmaster i can:
  
  create a new custom field set contact subtype custom fields:
  
  for use on individual > Volunteer
  
  add field: contact subtype field
  find (or create) a volunteer, and enter something into the new custom field
  export the contact (select fields Contact_id & contact subtype field (& down load the file)
  import the file, mapping the fields correctly
  
  downloaded file
  update contacts
  contact type = individual > subtype: Volunteer
  continue
  
  set mapping to correctly map to the custom field contact subtype field
  
  save mapping as... 'map 1'
  continue
  
  continue with import
  done
  change the contact subtype field label in the csv to foobar
  import the csv - loading the saved mapping 'map 1'
  
  mapping does not load + notice is thrown up onscreen:
  Notice: Undefined index: in CRM_Import_ImportProcessor->loadSavedMapping() (line 451 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Import/ImportProcessor.php).
  
  anyone else suffer with this problem or have any ideas?
  there's an issue logged here that has a fix, and is most likely related, but I'm not sure if this is a separate issue.
  Thanks in advance :)
  
  **Tags:** custom-fields, import, data-import, field-mapping
  
  > **Comments:**
  > **username_1**: Thanks username_0 for reporting, I could replicated this on https://dmaster.demo.civicrm.org/ which is running on 5.25 tree.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-02. Score: 2
  
  I have submitted a [PR](https://github.com/civicrm/civicrm-core/pull/16957) for this issue. Can you please try applying patch from [here](https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/16957.patch)?
  
  Thanks
  
  Pradeep
  
  > **Comments:**
  > **username_0**: That's wicked - thanks Pradeep. This all seems to work now - I can save mappings and they populate automatically - will post back here if I see any issues.  :D  
  > **username_2**: Thanks Pradeep!  
  > **username_1**: Can you mark this answered if it fixed your problem?  
  
  ---
  
  