In some cases, when the node form for example doesn't contain any fieldsets, the setSummary function is not available, and due to this node.js's code fails. There is no check if the function exists as in some other JavaScript files.

CommentFileSizeAuthor
node.js_.patch471 bytesPoetro

Comments

quiptime’s picture

Status: Active » Needs review
cburschka’s picture

Status: Needs review » Needs work

#445130: Namespace the Drupal jQuery functions renamed this function to drupalSetSummary(); needs a short reroll.

bcn’s picture

+++ modules/node/node.js        2010-03-25 00:17:01 +0000
@@ -4,6 +4,10 @@
+    if (typeof jQuery.fn.setSummary != 'undefined') {

Shouldn't this be if (typeof jQuery.fn.drupalSetSummary == 'undefined')?
I'm leaving as 'needs work' for now, but I've added a patch over at #445130: Namespace the Drupal jQuery functions that includes the fix for this issue too... If that get committed first, we can mark this as a duplicate.

jpmckinney’s picture

I had a look at the patch in #445130: Namespace the Drupal jQuery functions, but that patch doesn't replace all occurrences of setSummary with drupalSetSummary. I believe this should be set to be a dup of #770312: Calls to setSummary() must be renamed to drupalSetSummary(), which has a working patch that fixes the problem. I think #445130: Namespace the Drupal jQuery functions should be set back to fixed.

jpmckinney’s picture

Status: Needs work » Closed (duplicate)

I merged all the available patches from the three issues cited and set the issues to duplicate of #445130: Namespace the Drupal jQuery functions

cburschka’s picture

Status: Closed (duplicate) » Needs work

This bug doesn't have much in common with the namespacing thing, other than being related to the same function. As we found out in #24, #28 and #29 of the other issue, it's an edge case in multistep forms that should be investigated a bit more, while the other issue just needs to replace four outdated function names.

So I'd argue this isn't a duplicate we can simply merge into the other patch to fix two problems in one go. Setting this back to CNW since the last patch is out of date with HEAD.

jpmckinney’s picture

Ok, linking to relevant comments in other issue:

#445130-24: Namespace the Drupal jQuery functions
#445130-28: Namespace the Drupal jQuery functions
#445130-29: Namespace the Drupal jQuery functions

Most relevant in terms of tracking down the bug:

I've checked on the issue, and found the following in one of the node forms we developed:

    // Remove other node options, keep Status.
    $form['options']['#type'] = 'container';
    foreach (element_children($form['options']) as $key) {
      if ($key != 'status') {
        $form['options'][$key]['#access'] = FALSE;
      }
    }

This way the node.js is still added, as it is added to the form element $form['options'], but the fieldset preprocess doesn't happen, as there are no other fieldsets in this form, as they are moved to another step, or not fieldsets. Due to this, i don't know if it is core's fault, or our fault.

gapple’s picture

I ran into this when making modifications to the node form, pulling the revision information out of the vertical tabs and hiding the rest. Since the vertical tabs are no longer rendered, form.js isn't available, but node.js is still added in #attached.

Though it fixed the problem in my instance, just removing the attached scripts could cause other problems if another module made modifications.

      unset($form['revision_information']['#attached']);

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.