Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Within the implementation of this hook I return an array of pre-built options lists.
Something like
$lists[ $data -> id ] = array(
'title' => $data -> name,
'options callback' => 'mymodule_options_list',
'file' => MODULE_NAME . '.functions.inc'
);
Webform add these items to the pre-built lists set successfully, but does not call any of the callbacks of my custom lists - when I select one of them, it gives me an error saying that Options field is required. Which is fine, if you have chosen nothing in pre-built lists dropdown.
So apparently it doesn't call these callbacks at all.
Function _webform_select_options_callback in components/select.inc, which I supposed is meant to process these callback, is not called too.
Comments
Comment #1
quicksketchI'll need a more clear example to reproduce. As you've noted, Webform calls these functions successfully for it's own pre-built lists, there shouldn't be any difference for separate modules providing the same thing.
Comment #2
evgeny.chernyavskiy CreditAttribution: evgeny.chernyavskiy commentedComment #3
quicksketchYou code works fine for me. I modified it to look like this (since I didn't want to make a database table for it) and put it all in a casemgr.module file.
Comment #4
evgeny.chernyavskiy CreditAttribution: evgeny.chernyavskiy commentedOkay, for some magic reason (like real magic or my curved hands) it worked this time. Seems like the Webform (which I doubt) or Drupal itself cached the hook implementation and callback(s) implementation(s). Flushing caches from UI and truncating cache tables - at least 3 times each finally helped and Webform recognized all the custom stuff.
Sorry for that.
Closed, I guess.