When I use Panels to override a node add/edit form, it would seem that Panels adds a set of [form][/form] tags around the pane that contains node form elements *and* an extra set around CCK fields might happen to be defined on the node.

The latter appears to break IE, as it apparently interprets the [/form] after a CCK field as the end of ALL forms.

Chrome, Firefox and Safari are all happy to submit the form, despite having nested tags. Internet Explorer is not. I received a bug report from an IE7 user who was unable to save nodes (nothing happens when you click submit) and can confirm it also happens in IE9.

I expect the problem is that panels injects a bunch of nested [form] tags when it really should be using a singe one.

I'm not currently able to test on D7, but will when I get the chance.

CommentFileSizeAuthor
#3 panels-form-bug.txt50.66 KBRunePhilosof
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cafuego’s picture

Kind of related to #1158850: Cannot use multiple forms in the same panel (wrongly nested forms) probably, though I'm not using Views with it.

Letharion’s picture

I seem to remember from an unrelated discussion with a colleague that a large
wrapping element is the case in D7 as well, however, I haven't heard that this would break in IE.

RunePhilosof’s picture

FileSize
50.66 KB

This is also a problem for me in the newest version using D7.
Only when I activate panels_everywhere site_template though.
Then I get the problem in the user edit panel.

Steps to reproduce:
* Drupal 7.17
* Ctools 1.1
* Panels 3.3
* Panels_everywhere 1.0-rc1

Activate site_template, add a variant with page_content
Activate user_edit page, add a variant with the general form
Add a new user (user/1/edit uses different logic and theme)
Go to /user/2/edit, look at the html.
The HTML will contain a form element too early, see the attached panels-form-bug.txt, you will find two times two form tags.

RunePhilosof’s picture

Version: 6.x-3.9 » 7.x-3.3
RunePhilosof’s picture

I have a search form in my site_template. This bug naturally destroys the search form functionality on the edit page because nested form tags are disallowed and thus ignored.

noslokire’s picture

I think this is related to this #1649046: Node forms render as invalid HTML (two form tags) , only difference is that this one is user/edit and the other is node/edit

albib’s picture

If you are seeing to form tags in middle of the page the patch in #1649046: Node forms render as invalid HTML (two form tags) solves the problem.

But if you use Panels everywhere you get a form tag put around the entire page. Our solution is to use hook_page_manager_contexts_alter() in order to remove the form tag:

function MYMODULE_page_manager_contexts_alter(&$contexts, $placeholders) {
  foreach ($contexts as $id => $context) {
    if (!empty($context->form_id)) {
      unset($context->form_id);
    }
  }
}
RunePhilosof’s picture

#6: That patch doesn't help much. Before I had two times two form tags, with that patch I have two times one form tag. It doesn't change my problem.

RunePhilosof’s picture

Earlier I wrote that /user/1/edit didn't exhibit the problem.
However, in my current test it was present in /user/1/edit.
So no need to create a user for this test.