Since everything other callback is hooked up to the module that defines the component, it would make sense to document that you need to supply the path parameter in the API for this function to make it obvious that you are simply providing a wrapper for third party modules and that you are not automating this too. (Or better define path for the module if file defined when parsing these details - an API change maybe now best left to 8.x branch)


 * Module specific instance of hook_theme().
 * This allows each Webform component to add information into hook_theme().
 * If you specify a file to include, you must define the path to the module that this
 * file belongs to.
function _webform_theme_component() {
  return array(
    'webform_grid' => array(
      'render element' => 'element',
      'file' => 'components/',
      'path' => drupal_get_path('module', 'webform'),
    'webform_display_grid' => array(
      'render element' => 'element',
      'file' => 'components/',
      'path' => drupal_get_path('module', 'webform'),
Members fund testing for the Drupal project. Drupal Association Learn more


fenstrat’s picture

Status: Active » Fixed
925 bytes

Yep, this make sense, I've come across this as well. Committed the attached patch to 7.x-4.x, 6.x-3.x and 7.x-3.x.

Getting webform to auto set a path value based on the defining module is an interesting idea, but it is standard practice to set a path value when setting a file value in theme implementations, so I think this doc clarification will cover this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.