Event query parameter check for with live options enabled fails if the field is not hidden

Created on 6 June 2024, 7 months ago
Updated 22 June 2024, 6 months ago

I have an event registration form that allows passing in the event id via a query parameter. I added two new events, but these cannot be auto selected via the query paramater.

During debugging, I. can see that getExposedOptions method checks for the live options in the options element, but it is only getting the items that are in the source of the element. It looks like it only checks for live options if the field is hidden.

if ($field && $field['#type'] == 'hidden') {
      // Fetch live options
      $exposed = $this->utils->wf_crm_field_options($field, 'civicrm_live_options', $this->data);
      foreach ($exclude as $i) {
        unset($exposed[$i]);
      }
      return $exposed;
    }

I am using a handler to hide the option element as I need to read which option is selected in the handler, and this always fails if it is hidden.

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

🇦🇺Australia nicholosophy Brisbane

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024