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 inconsistencies with date fields #635

Merged
merged 1 commit into from
Dec 18, 2021

Conversation

jitendrapurohit
Copy link
Collaborator

Overview

Fix issues with date fields.

Before

Issue 1: Custom date field is not loaded as default when the format is year only. To replicate

  • Create a custom date field with format = yearonly
  • Enable this on the webform.
  • Since this is a yearonly field, change the type of this element from the build page.

Type: Date list

image

  • Make sure a contact A in civi is holding a value for this field.
  • Load the webform with c1 = A loaded by default. i.e cid1=xx in the url.
  • The year only date field is not loaded with the existing value from CiviCRM.

Issue 2: Same webform:

  • Remove the default setting from existing contact element and change the widget to Autocomplete.
  • Load the webform and select a contact from autocomplete contact field.
  • The year value is not retrieved.

Issue 3: Same webform.

  • Enter a default value of the year only date field to today.

image

  • Edit Existing contact element: make sure the custom field is select to no autofill.

image

  • Load the webform and ensure the date field value is set correctly before and after selecting a contact. i.e, it should stay as today's year.

After

Fixed. All 3 cases work as expected.

@mpaulso
Copy link

mpaulso commented Dec 11, 2021

Before the PR

image

image

@mpaulso
Copy link

mpaulso commented Dec 11, 2021

After PR
image

@mpaulso
Copy link

mpaulso commented Dec 11, 2021

Passing in cid1
image

@mpaulso
Copy link

mpaulso commented Dec 11, 2021

changing to autocomplete - please note -> YEAR is not loaded

image

@KarinG
Copy link
Collaborator

KarinG commented Dec 11, 2021

So from our testing summary:

  • current user ✅ shows Year
  • ?cid = ✅ shows Year
  • autocomplete [changed widget static->autocomplete + deselect "Use contact id from UR"L checkbox] does not show Year

@jitendrapurohit
Copy link
Collaborator Author

autocomplete [changed widget static->autocomplete + deselect "Use contact id from UR"L checkbox] does not show Year

Seems similar to this issue fixed here https://github.com/colemanw/webform_civicrm/pull/666/files. I've included the loading of date fields in that PR.

@KarinG
Copy link
Collaborator

KarinG commented Dec 18, 2021

After PR 666 -> this is now working 🎉 ->

image

@KarinG
Copy link
Collaborator

KarinG commented Dec 18, 2021

Automated tests ✅
Live site check ✅
Screenshot (above)

@KarinG KarinG merged commit 32e5b2b into colemanw:6.x Dec 18, 2021
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.

3 participants