mecachisenros / cf-civicrm

Caldera Forms CiviCRM Integration
GNU Affero General Public License v3.0
30 stars 26 forks source link

Set address as home address works but fails (weird) #203

Open jbonlinea opened 3 years ago

jbonlinea commented 3 years ago

Hi there

thank's for this plug-in which is a real game changer for wp users !

Describe the bug

Not sure if it's a bug, and it may not fully be stemming from cf-civicrm,we'll see :)

the main background to have in mind is that I have a form which update a contact address, so far so good !

Context

I do use @christianwach civicrm-wp-profile-sync, and use it to sync wp-user fields with civi-contact field, it work's great. The edits done on the wp-user are synced into it civi-contact counterpart, and the other way round. Great. really great !

I also use, as suggested, a shortcode to display user data on the front end, namely [cai_address] ; this also works great

Form detail and submission

When I submit my form it update my civi-contact, the civi-contact is well updated. Great

This works whether I use :

Both give the exact same result, in both updating the contact, and regarding the issue describe in the next section.

Also, but this is may be a different matter, after my form submission, the wp-user field are updated as I expect, also great.

the weirdness

Here, It'll be easier to say now that the issue only occurs when the address type selected in caldera processor is "home". I've trie with "work" and with "other" without fuss.

After the form submission, Civi contact home address is updated, and the data appears as a home address. The same goes for wp-user, the address is updated and appears as the home address.

However, [cai_address] do recognise this address as a "home" type address anymore.

Some observations and details

[cai_address] display the address type (or location type) above the address itself.

Before, form submission (understand that the contact or the user have been edited lastly from civi or wp dashboard) [cai_address] displays "home address" before the address itself

After cf form submission, [cai_address] do not "home address" but "address" only, before the address itself

If I go to my civi-contact, modify and save it (with no modification), then [cai_address] do recognise the address as a home address again and displays "home address" before the address itself. The same goes if i modify and save the wp-user (with no modification), just like above.

Further [cai_address] can handle a "location_type" parameter, whihch behaviour is in line with the above. If I set the location type to "1" (corresponding to the home address/location) and the last change to my contact/user have been done from civi or wp dashboard, the address is displayed. But if the last change has been done with cf form, then the address is not displayed.

Note, Importantly, that if I do use the exact same form, and only change the location type in the processor, for instance to "work", then the issue do not occurs ?!

In the end, this issue only applies to the home address (which is also the native and default address in civi, with no changes) AND updating this home address with the cf form civi processor.

Any thought on that ?

Regards

To Reproduce

well, install civi and christian plugin, set an ac addres field for users create a form to update contact address, chose home address, and submit the form then display the address it thank's the the shortcode above

Every address type are recognised as being of their type but home which is not recognised as any type

Expected behavior that any addresse updated through caldera processors remain recognised as the type choosen in the processor

Screenshots I could send you a video in private if needed it 'll be easier

Desktop (please complete the following information):

Additional context see above

agileware-justin commented 3 years ago

@jbonlinea you might want to post this issue over here, https://github.com/christianwach/civicrm-acf-integration - just because the problem you are describing is not something I've ever seen when using CF CiviCRM - and we use it a lot in our projects.