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#1426 Return correct manager role info during Case api get #16006

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

demeritcowboy
Copy link
Contributor

Overview

Case api get is supposed to return manager and creator flags in the 'contacts' element in the array. It stopped doing that in 5.16.

Before

Before 5.16:

                            [0] => Array
                                (
                                    [contact_id] => 2
                                    [display_name] => Something
                                    [sort_name] => Something
                                    [relationship_type_id] => 9
                                    [role] => Case Coordinator
                                    [email] => demo@example.com
                                    [phone] =>
                                    [creator] => 1
                                    [manager] => 1
                                )

5.16+

                            [0] => Array
                                (
                                    [contact_id] => 2
                                    [display_name] => Something
                                    [sort_name] => Something
                                    [relationship_type_id] => 9
                                    [role] => Case Coordinator is
                                    [email] => demo@example.com
                                    [phone] =>
                                )

After

                            [0] => Array
                                (
                                    [contact_id] => 2
                                    [display_name] => Something
                                    [sort_name] => Something
                                    [relationship_type_id] => 9
                                    [role] => Case Coordinator is
                                    [email] => demo@example.com
                                    [phone] =>
                                    [creator] => 1
                                    [manager] => 1
                                )

Technical Details

There is an existing unit test but it doesn't trigger because the role is no longer present so it doesn't even check. Have updated the test to additionally confirm the role is present. The test might still be problematic because "role" in the array is the label not the name so it's comparing against label, but leaving that out of this PR since the test is at least comparing against fixed things.

I reviewed where the api/manager info might elsewhere be used in a comment at https://lab.civicrm.org/dev/core/issues/1426#note_28318. It's mostly red herrings though so not reposting here.

Comments

Ping @tunbola @alifrumin @agh1

@civibot
Copy link

civibot bot commented Dec 2, 2019

(Standard links)

@civibot civibot bot added the master label Dec 2, 2019
@alifrumin
Copy link
Contributor

  • General standards
    • (r-explain) PASS described clearly
    • (r-user) PASS
    • (r-doc) PASS
    • (r-run) PASS I was able to replicate that there are no creator/manager flags in the contacts array when doing a case.get api call without this change HOWEVER they do appear with this change.
  • Developer standards

@seamuslee001 this looks ready to be merged to me.

@colemanw colemanw merged commit 6fe7706 into civicrm:master Dec 4, 2019
@demeritcowboy demeritcowboy deleted the case-role-manager-api branch December 5, 2019 04:01
@demeritcowboy
Copy link
Contributor Author

Thanks!

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.

3 participants