1.0 Problem/Motivation
I have a field on the webform which has 'User Select' for setting two Tags associated with a Contact, i.e. Multiple valued.

  • If the box is ticked the Tag is set.
  • If the box is unticked the Tag is unchanged, whether set originally or not.

I suspect from the code that the same may be true of Groups, but not yet tried.

2.0 Detailed steps to reproduce (embed screenshots)
See sample webform attached.
Running Webform_civicrm 8.x-5.0-beta4, Webform 6.0.0, CiviCRM 5.33.2.

3.0 Observations so far
This appears to be down to code not creating the $add and $remove arrays correctly in saveGroupsAndTags() in the file wf_crm_webform_preprocess.inc, or in the getExposedOptions() function which it calls. I do not understand this code well enough to debug it any further.

The screenshot shows the content of $contact when entering saveGroupsAndTags(), and $add and $remove at the end, with one box ticked and the other unticked.

I note that getExposedOptions() is looking for Live and Static options, and I also note that on the configuration screen neither the Live or Static setting causes any options to be displayed. Could this be related?

Finally, the fact that there is a line in $add of '12 => 0' means that after applying the $add = array_combine($add, $add); on line 932 it goes on to try to create a Tag with Id zero, and throws a PHP Error. I don't know if this will go away by fixing the above.

CommentFileSizeAuthor
Screenshot 2021-01-27 103342.png27.29 KBAnonymous (not verified)
webform.webform.testwf.yml9.79 KBAnonymous (not verified)

Comments

Anonymous’s picture

maynardsmith created an issue. See original summary.

Anonymous’s picture

Status: Active » Closed (duplicate)