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

dev/core#866, dev/core#1318 Fix failure to import checkboxes for activities #19111

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

This seeks to address a long-standing issue whereby checkboxes cannot be imported onto
activities if the name and value match.
https://lab.civicrm.org/dev/core/-/issues/1318
https://lab.civicrm.org/dev/core/-/issues/866
https://issues.civicrm.org/jira/browse/CRM-17493

Before

Screenshot from 2020-12-04 17-25-00

After

above works and has unit test cover

Technical Details

Since this code was written the create was switched from a BAO create to the
activity api create. Simply removing the handling to prepare for the BAO create
allows the api to do it correctly

Comments

Since this is just removing code & adding a test the main review task is r-run. However, it might require a reviewer to think about testing different custom field types to be sure

My test csv looked like this

Contact id cust field Activity Type ID Date subject
24 maybe Phone call 2020-01-02 Interesting

@civibot
Copy link

civibot bot commented Dec 4, 2020

(Standard links)

@civibot civibot bot added the master label Dec 4, 2020
@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 this was also part of my import clean up - although it is on activity

@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit (cc @petednz) I wonder if you would be able to review this - it might take a little bit of thought to do a suitable r-run

@mattwire
Copy link
Contributor

mattwire commented Jan 7, 2021

@eileenmcnaughton Needs rebase

@eileenmcnaughton
Copy link
Contributor Author

rebased now - just need to check if it still passes

@eileenmcnaughton
Copy link
Contributor Author

Passing now...

…vities

This seeks to address a long-standing issue whereby checkboxes cannot be imported onto
activities if the name and value match.

Since this code was written the create was switched from a BAO create to the
activity api create. Simply removing the handling to prepare for the BAO create
allows the api to do it correctly
@colemanw
Copy link
Member

retest this please

@eileenmcnaughton
Copy link
Contributor Author

@colemanw green

@eileenmcnaughton
Copy link
Contributor Author

Hmm - my other tests build on this so I can't submit them until this is merged

@seamuslee001
Copy link
Contributor

@eileenmcnaughton I tried testing this on my local I created a custom field set for all activates and created a checkbox single field and a radio field and a text field

When I imported the sheet It didn't give me errors and viewing the activity record showed the correct information as per this screenshot

activity_view

However on clicking edit I found that the checkbox for the Hello option wasn't being checked as per the below screenshot

activity_edit

This is my custom field configuration

Custom field Config

@demeritcowboy
Copy link
Contributor

That's odd, especially if it shows on view. When I try it the checkbox looks ok for me on edit. Is it a value/label thing like you originally had Hello and then changed it to "2"? Then it might show on view if the value is stored in custom_value_X as Hello, but it wouldn't match the checkbox value of "2".

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 is that regressive? If not it will be easier for me to address it if this is merged first

@eileenmcnaughton
Copy link
Contributor Author

(I'm assuming the issue is the value separator not being wrapped correctly)

@demeritcowboy
Copy link
Contributor

I've tried a couple things and haven't seen anything unusual except some preexisting date issues. I'm not seeing what Seamus is seeing with the checkbox.

@seamuslee001
Copy link
Contributor

yeh I'm not sure what happened with my import but I'm comfortable with this PR if @demeritcowboy is

@demeritcowboy
Copy link
Contributor

demeritcowboy commented Jan 26, 2021

Ok. I've added some wording to the dev digest as a candidate for the next one.

(Edited to remove the link so bots don't use it as food.)

@eileenmcnaughton
Copy link
Contributor Author

Thanks @demeritcowboy @seamuslee001

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 were you going to merge this?

@seamuslee001
Copy link
Contributor

Merging as per review by @demeritcowboy

@seamuslee001 seamuslee001 merged commit 5576e27 into civicrm:master Jan 28, 2021
@seamuslee001 seamuslee001 deleted the act_custom branch January 28, 2021 22:49
@eileenmcnaughton
Copy link
Contributor Author

thanks

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

Successfully merging this pull request may close these issues.

5 participants