Page: node/227/webform/conditionals
Every time I'm reloading the page I get these two messages.
Notice: Undefined index: #name in foo_preprocess_textfield() (line 213 of sites\all\themes\foo\theme.form.inc).
Notice: Undefined index: #name in foo_preprocess_textfield() (line 213 of sites\all\themes\foo\theme.form.inc).
This means the form name is not defined.
/**
* Implements theme_preprocess_textfield().
*/
function foo_preprocess_textfield(&$variables) {
switch ($variables['element']['#name']) {
case 'search_block_form':
...
Comments
Comment #1
quicksketchThis is probably caused by Webform's conditional fields. When you select a source component, the "value" field for each component is created via JavaScript. These fields are pre-rendered client-side and then JS populates the appropriate "name" attribute when the field is used. This approach makes it so that building conditionals still utilizes the theme layer for generating fields but doesn't require an AJAX request to create the field.
Either that or this problem is caused by date and time fields, which again use textfields rendered server-side. See webform_conditional_form_date() and webform_conditional_form_time(). Which kind of components seem to be causing the problem?
Comment #2
hass commentedMissed to attach debug out. Looks like a date field.
Comment #3
danchadwick commentedClosed for lack of activity. Please re-open if this is still an issue in the latest 7.x-4.x-dev.
Comment #4
hass commentedBug has not fixed.
Comment #5
danchadwick commentedFrom quicksketch's answer, I believe this is something that you will have to work around in your foo theme.
Comment #6
hass commentedNope, the bug need to be fixed in the module.
Comment #7
danchadwick commentedI'll be happy to review and commit any patch you provide.
I am trying to work through a multi-year old backlog of issues on the current release. This is not an issue that I plan on working on, and I'm pretty sure quicksketch isn't either. The workaround is trivial, and without investigating further, it appears that that changes here may have unintended consequences. Let's leave the status as postponed, pending your patch.
Comment #8
hass commentedComment #10
danchadwick commentedCommitted to 7.x-4.x and 8.x.