Titles and descriptions are not shown on most elements that are altered by IFE.
By setting #theme_wrappers on elements at the form_alter stage, default #theme_wrappers for those elements are not loaded. Most elements need the form_element wrapper which adds the title & description.

The attached patch adds IFE's theme wrapper at the pre_render stage, at which point the default theme wrappers will have been added.

I attach two patches - the standard one that has gone through format-patch, and a simple one (using --no-prefix) that is compatible with Drush.

Comments

james.williams’s picture

Ah - I just noticed that doesn't work with the checkboxes/radios types. I'll do some more testing/fixing & do another patch, sorry!

james.williams’s picture

Okay this is better - I've tested the attached patch with all standard core D7 form elements and wrappers (i.e. containers as well as fieldsets), and added some special handling of text_format elements (these don't work correctly otherwise).

The problem with my approach in the initial patch just replicated the problem with default theme_wrappers for default pre_render functions instead!

There was a change to form_get_errors() in D7, which caused some different behaviour - I've fixed that too. So this patch effectively finishes porting this module to D7. I hope!

james.williams’s picture

Finally, this patch includes all of the above, but also updates the support for contrib field types. Old CCK element types that don't get used any more have been removed, I've updated support for the various element types provided by Date & Link module, and sneakily added support for webform's element types too :-)

I hope this is helpful!

stijndm’s picture

Hi James, this all sounds good. I'll have a look as soon as possible.

I'm currently looking in to ways of getting rid of the ife_field_types() so all elements are supported automatically, so I'm not sure what I'll do with that.

james.williams’s picture

Cool, glad to know I'm not only one who will find it useful :-)

I've just discovered two more issues with the latest patch - this one now adds support for elements within any other element (i.e. not just fieldsets & containers -- for example, webform module can put things within 'value' elements), and the renamed user_register_form default.

davidwhthomas’s picture

Status: Needs review » Reviewed & tested by the community

+1 to the above patch in #5, fixed the issue with IFE not working on user profile forms and got the errors showing in the correct place inline, with thanks.

DT

james.williams’s picture

:-)

himerus’s picture

+1 for this patch.

rdeboer’s picture

For those not comfortable with applying patches see #1480074: Accessibility feature: change errors at top to links clicking through to the form error element for a downloadable tar bal (i.e. ife.tgz) that also includes an additional feature.

ipwa’s picture

+1 Patch worked for me.

stijndm’s picture

Status: Reviewed & tested by the community » Fixed

I have no idea why this has been in the queue for so long. All code is now commited to dev. I split the patch into several commits as it addresses several unrelated issues.

Status: Fixed » Closed (fixed)

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