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

Fix APIv3 profile.getfields to return correctly keyed phone field #19321

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jan 5, 2021

Overview

This fixes the phone profile field to have the correct field key to match profile forms.
Fixes civicrm/org.civicrm.contactlayout#91

Before

Key returned by api does not match form key for the phone field.

After

Matches and ContactLayout is able to function correctly.

Technical Details

The field key is supposed to be phone-[location_type_id|'Primary']-[phone_type_id].

@civibot
Copy link

civibot bot commented Jan 5, 2021

(Standard links)

@civibot civibot bot added the master label Jan 5, 2021
@seamuslee001
Copy link
Contributor

@colemanw test fails look related

@eileenmcnaughton
Copy link
Contributor

api_v3_ProfileTest::testGetFields
Failure in api call for profile getfields: Undefined index: email
#0 /home/jenkins/bknix-dfl/build/core-19321-4qeeq/web/sites/all/modules/civicrm/api/v3/Profile.php(577): PHPUnit\Util\ErrorHandler::handleError(8, 'Undefined index...', '/home/jenkins/b...', 577, Array)
#1 /home/jenkins/bknix-dfl/build/core-19321-4qeeq/web/sites/all/modules/civicrm/api/v3/Profile.php(301): _civicrm_api3_buildprofile_submitfields(23, false, NULL)

This fixes the phone profile field to have the correct field key to match profile forms.
Fixes civicrm/org.civicrm.contactlayout#91
@eileenmcnaughton
Copy link
Contributor

Tests are passing. I'm kind of taking your word + tests word on this since it's an obscure code area & you have one of the few interactions under your care

@eileenmcnaughton eileenmcnaughton merged commit decbea7 into civicrm:master Jan 6, 2021
@eileenmcnaughton eileenmcnaughton deleted the profileGetFieldsFix branch January 6, 2021 18:18
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.

Primary phone number does not save when included as part of a profile
3 participants