Placing forms inside panels_everywhere does not mark form elements that contain errors in some cases and does not display the error messages in other cases.

What I did to achieve this:

  1. Enable the default site template provided by PE.
  2. Add the "Page Messages" pane
  3. Add forms inside it (in my case the login form and a subscription form provided by simplenews).
  4. I submitted both forms without providing any data.

In the case of the login form the form elements are marked that they contain errors, but no error messages is being displayed. The error message appears on the next page load.

In the case of the simplenews subscription form (this is the actual issue I am facing) the exact opposite happens. The error message is being displayed correctly, but the form element are not marked that they contain errors.

Interestingly when using PE 7.x-1.0-rc1 the simplenews subscription form behaves the same way the login form does, but still not properly.

Any ideas why this is happening?

CommentFileSizeAuthor
#6 panels_everywhere-n2305533-6.patch719 bytesDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Title: Placing forms inside panels_everywhere does not handle form errors properly » Forms in site template do not handle field errors correctly

With the current version of the module, the form fields are not highlighted correctly but the message is displayed.

Ec1ipsis’s picture

Damien, is there any additional information you can provide on why this is happening? We're encountering this problem on a project and would be very eager to help solve it.

DamienMcKenna’s picture

It needs someone to dig into the problem, miner's helmet and shovel in hand, and work out a fix.

DamienMcKenna’s picture

Some further testing:

  • The fields on a node/add/* page are not highlighted correctly, but the form error message is displayed correctly.
  • The comments form, added to a Panelizer page display, does work correctly - the error message is displayed and the field causing the error is highlighted.
DamienMcKenna’s picture

Examining it further, it seems the node/add/* problem I mentioned in #4 is just a theming bug - the site's theme was loading after system.theme.css, so the input.error definition was being overridden by the generic formatting.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
719 bytes

I've confirmed that this is a theming issue by customizing the field definition from the Search API Page search block - if the 'keywords' field is left empty the form will throw an error saying it is required and add the "error" class to the field, but the site's theme overrides it.

This patch adds a note to the README.txt file about the problem.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed 5e5bb06 on 6.x-1.x
    Issue #2305533 by DamienMcKenna: Documented theming problem with form...

  • DamienMcKenna committed a335752 on
    Issue #2305533 by DamienMcKenna: Documented theming problem with form...

Status: Fixed » Closed (fixed)

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