Notice: Undefined index: #title in webform_hints_add_title() (line 192 of modules/all/webform_hints/webform_hints.module).

I am getting the above error when I hit save on a webform_default_fields webform

Comments

SocialNicheGuru created an issue. See original summary.

socialnicheguru’s picture

Status: Active » Needs review
StatusFileSize
new723 bytes

I added a patch because some elements do not have labels or titles. I am not sure if it is by design or not.
An autocomplete textfield is a good example. Webform_addressfield_extras returns an autocomplete text field without labels.

socialnicheguru’s picture

Please use this patch instead.

socialnicheguru’s picture

StatusFileSize
new723 bytes
socialnicheguru’s picture

hmmm. I wonder if it is a problem with addressfield_tokens https://www.drupal.org/node/2570653

guschilds’s picture

Status: Needs review » Closed (works as designed)

SocialNicheGuru,

By default the module only supports these types of Webform components: textfield, textarea, webform_email, webform_number, and select. Were you using hook_webform_hints_fieldtypes_alter() to add addressfield components to that list? That looks to be the only way you could've gotten to line 192 with that type of component to get the error you're showing. If not, please provide thorough steps to reproduce that we an try.

It isn't that it's really a problem with addressfield_tokens, it's just that this module doesn't support those components. Because the module sticks to "core" Webform components, it likely never will. In addition, adding addressfield components to the list of supported components using hook_webform_hints_fieldtypes_alter() may cause the error you've reported because the component's array has a unique structure.

Getting it to work with addressfield components will require code similar to that in #2570653: webform_hints support, whether that patch gets committed to addressfield_tokens or is custom code elsewhere in your codebase (it's implementing hook_webform_hints_element_alter() and custom code can do the same). Does that make sense?

I'm going to close this as "works as designed", but please reopen if you end up thinking there is an issue with this module and can provide steps for us to get there. Thanks!