It is currently impossible to have multiple node forms on one page due to fixed IDs. node.js relies for example on 'fieldset#edit-revision-information' and 'fieldset#edit-author'.

When you have two node forms on a single page node.js will work for the first.

CommentFileSizeAuthor
#5 955610.patch14.45 KBcasey
#2 955610.patch10.42 KBcasey

Comments

casey’s picture

Another example: comment_form_node_form_alter() contains fixed IDs '#edit-comment-0' to '#edit-comment-2'

casey’s picture

Status: Active » Needs review
StatusFileSize
new10.42 KB
moshe weitzman’s picture

Would this make it harder to target node forms via css/js? Do all node forms have a common class?

moshe weitzman’s picture

Would this make it harder to target node forms via css/js? Should all node forms have a common class?

casey’s picture

StatusFileSize
new14.45 KB

No not at all.

Reroll uses classes instead of names which is even more generic. Also altered menu.js' Drupal.behaviors.menuLinkAutomaticTitle to make it work for multiple node forms.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

OK, lets do this.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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

sun’s picture

Status: Closed (fixed) » Needs work
+++ modules/menu/menu.js	30 Oct 2010 16:51:35 -0000
@@ -20,44 +20,46 @@
+    $('fieldset.menu-link-form', context).each(function () {

Should have been .once(), not .each().

Powered by Dreditor.

  • Dries committed ae85abb on 8.3.x
    - Patch #955610 by casey: impossible to have multiple node forms on one...

  • Dries committed ae85abb on 8.3.x
    - Patch #955610 by casey: impossible to have multiple node forms on one...

  • Dries committed ae85abb on 8.4.x
    - Patch #955610 by casey: impossible to have multiple node forms on one...

  • Dries committed ae85abb on 8.4.x
    - Patch #955610 by casey: impossible to have multiple node forms on one...

  • Dries committed ae85abb on 9.1.x
    - Patch #955610 by casey: impossible to have multiple node forms on one...

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.