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

Check entity type is set on webform settings before compare #146

Merged
merged 1 commit into from
Aug 6, 2018
Merged

Check entity type is set on webform settings before compare #146

merged 1 commit into from
Aug 6, 2018

Conversation

beto-aveiga
Copy link
Contributor

Overview

Webforms with phones and selectable type are not retrieving data from contacts on webform load. The user sees as if no information was previously saved and once the user saves data (if any) will be overwritten.

Before

  1. Initial data for contact
    image

Same Initial data. Showing type and location for phone.
image

  1. Phone field configured with type selectable by the user.
    image

  2. Retrieving phone data without checking existence of type index on webform settings causes data to be seen as different from the webform configuration, thus not showing any phone related data at all from the contact.
    image

After

  1. Repeat steps 1 to 3 from "Before".

  2. Information is now retrieved correctly, producing expected results on save.
    image

Technical Details

@beto-aveiga
Copy link
Contributor Author

@KarinG Please don't test/merge it yet. I have to fix a minor thing in the condition to avoid notices.

@beto-aveiga
Copy link
Contributor Author

@KarinG You can continue with the testing. I corrected the last commit, the condition had a small issue. Now it is good.

@beto-aveiga
Copy link
Contributor Author

@KarinG @colemanw I merged locally #146 and #148 into the master of this repo. I made several tests and everything worked just fine.
I tested with multiple emails, multiple addresses, and multiple phones. Also tested with multiple fields with location types selectable by the user, and the results were the the expected results.
If there is something else to do please tell me, I need the both mentioned branches get merged as soon as possible to incorporate those changes in a patched version of webform_civicrm, for CiviHR and probably CiviCRM.
Thanks!

@colemanw
Copy link
Owner

colemanw commented Aug 6, 2018

I'm comfortable merging this because it's a simple addition of isset() which is generally a good practice.

@colemanw colemanw merged commit 4311abe into colemanw:7.x-4.x Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants