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

CRM-18959: Import fails when custom multi-value date field is imported. #8662

Closed
wants to merge 2 commits into from

Conversation

darrick
Copy link
Contributor

@darrick darrick commented Jul 3, 2016

Different path for solving: CRM-18959
Other solution is PR-8566
Also reverts CRM-18708

The guts of the custom import have always supported importing to contact sub types (CRM-5125). However, at some point mapping the "Contact Sub Type" was dropped from the form. This PR restores that option.

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@JoeMurray
Copy link
Contributor

JoeMurray commented Jul 4, 2016

jenkins, please retest

@seamuslee001
Copy link
Contributor

I tested this and it seems to work ok, the only thing i would have to say is that it will allow imports for contacts that don't have the same sub type as selected and or same sub type as the custom group. E.g. I was able to import to a contact that had no contact subtype set. To me I think we may want some validation on that part

@darrick
Copy link
Contributor Author

darrick commented Jul 5, 2016

@seamuslee001 I'm not surprised. I don't have much skin in the game. Don't use this functionality but was doing peer review at the request of @JoeMurray. That said it would be good to identify exactly what steps this import should take.
I.e.
For custom groups tied to a Contact Type:

  • Should AJAX be used to filter the "Multi-value Custom Data" to only allow the user to select custom groups attached to the selected Content Type?
  • Should the same be done for Custom Groups attached to Sub Content Types.
  • Meaning if "Individual" is selected only Custom Groups attached to Individual and Sub Contact Types of Individual are selectable.
  • If a custom group tied to a Contact Type is selected but then a sub contact type mapping is chosen on the next page should the records only be imported for Contacts with that sub contact type. Or should should the sub contact type not be mapable.

So on and so forth as I'm sure there are other varieties. I did add help for Contact Type and SubType copied from the import contact page.

@totten
Copy link
Member

totten commented Jul 6, 2016

jenkins, add to whitelist

@eileenmcnaughton
Copy link
Contributor

@darrick are you ok to fix the style warnings? https://test.civicrm.org/job/CiviCRM-Core-PR/10535/checkstyleResult/new/

@eileenmcnaughton eileenmcnaughton mentioned this pull request Jul 11, 2016
@monishdeb
Copy link
Member

@darrick is there anything left to fix ?

@eileenmcnaughton should I close #8566 ? because it seems current changes does the same with a better solution.

@eileenmcnaughton
Copy link
Contributor

@monishdeb that sounds about right - @seamuslee001 is anything from your comments above a blocker to merging this & closing the other?

@darrick
Copy link
Contributor Author

darrick commented Aug 3, 2016

I'm on vacation. There is a work around by setting both "Contact Type" and Contact Sub Type" fields in the csv file. It would be best to delineate the use cases CiviCRM is going to support on this form and then tune the PR accordingly.

@monishdeb
Copy link
Member

@darrick did you had a chance to look at this PR? Also can you rebase this PR as it gone stale.

Steps to rebase:

$ cd civicrm
$ git fetch upstream master
$ git pull --rebase upstream master 
// resolve merge conflicts if any
$ git push -f origin CRM-18959

@JoeMurray
Copy link
Contributor

@darrick doesn't have much skin in this game. Let's us do the work.

@eileenmcnaughton
Copy link
Contributor

When I look at this there are a number of small discreet code tidy-ups which seem worth pulling out, reviewing, & merging & then we need to figure out how to replicate the main part in a unit test

@eileenmcnaughton
Copy link
Contributor

I'm closing this as an alternate fix has been merged -basically retrieving the sub_type from the contact id (which is required for this import I believe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants