0

When a custom field with radio options is created it has sometimes a clear option (see below).enter image description here.

And sometimes it's not available like the color field. The first thought is that the reason is that the color field is mandatory, so the clear option is not needed, but that's is not the case. It is also optional. The missing clear option is annoying because it's not possible to undo a wrong choice. The used CiviCRM version is 5.28.

1
  • Is there a fix for this bug ? On the issue, Kainuk gives some details but I don't find the code to add the possibility to clear radio choice. In TD, class "html-adjust" of templates/CRM/Custom/Form/Edit/CustomField.tpl file, I don't find how function addOptionsEditLink is called, I only see an "elseif" which include CRM/Custom/Form/ContactReference.tpl file. The function addOptionsEditLink is in CRM/Core/Form/Renderer.php file and probably need to change this condition on line 129 "if (in_array($element->getType(), $typesToShowEditLink) && $hasEditPath) {"
    – Alain Rihs
    Apr 29 at 10:45
4

The difference is in the definition. The color field has the Options Per Line set. This has as a side-effect that it disables the clear box (and the change options wrench). Clearing this field makes the clear option return. enter image description here

3
  • 1
    Good to know, but sounds like a bug. Being able to clear options should not depend on the layout. I'd suggest logging that as an issue on lab.civicrm.org
    – Aidan
    Jun 15 '20 at 10:04
  • @Aidan, you right, it is a bug. I will make an issue. I post it here because for some users this workaround will be fine. Jun 15 '20 at 12:45
  • I created the issue lab.civicrm.org/dev/core/-/issues/1821 Jun 15 '20 at 13:04
0

The answer posted by Kainuk sounds like a bug in civicrm. After it is fixed and still the "clear" option is not visible, make sure the custom field is not set to "Required".

Required custom fields do not have the clear option displaying on the radio custom field.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.