Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#7642 closed defect (bug) (fixed)

scriptaculous-root loads the wrong mainfile and forces loading all the time all components instead of specific component

Reported by: codestyling Owned by: westi
Milestone: 2.7 Priority: high
Severity: major Version: 2.6
Component: General Keywords: javascript speed delivery time has-patch
Focuses: Cc:


At file script-loader.php the following line can be found:

$scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/scriptaculous.js', array('prototype'), '1.8.0');

It defines the Scriptaculous-root file to original one. If you only want to load effects.js you would address this using:


But it behaves not as expected, it loads nevertheless all components like slider.js, builder.js and so on too.

The definition of scriptaculous-root is wrong and should address the right file instead:

$scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.8.0');

in other words it should be .../wp-scriptaculous.js instead of .../scriptaculous.js because the original file loads by default all components and the wp- version doesn't load them (opposite behavoir introduction by mdawaffe serveral versions ago).

Attachments (1)

scriptaculous-root.diff (918 bytes) - added by vladimir_kolesnikov 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 @westi
7 years ago

  • Keywords reporter-feedback added; scripting scriptaculous bug removed
  • Milestone changed from 2.7 to 2.8
  • Priority changed from high to normal
  • Severity changed from major to normal

What exactly is the issue here.

I don't quite follow the explanation.

Can we have some example code to show the issue.

#2 @codestyling
7 years ago

I have done a more complete description at my blog: http://www.code-styling.de/english/wordpress-261-loads-too-many-scriptaculous-components
and also decribed the patch working correctly.

#3 @codestyling
7 years ago

  • Keywords javascript speed delivery time added; reporter-feedback removed
  • Milestone changed from 2.8 to 2.7
  • Priority changed from normal to high
  • Severity changed from normal to major

What's about this 3 character fix, fully described at my page (link above)?
This decreases the delivery speed of several blogs, because unwanted script files will be shipped!
Can this bug please be fixed?

#4 @vladimir_kolesnikov
7 years ago

  • Keywords has-patch added

Patch attached.

#5 @westi
7 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

Ok reading in to this a bit more I know understand the issue.

By default scriptaculous brings in the other js files itself.

A while back we created wp-scriptaculous.js to remove that behaviour but it was not referenced by the script-loader so pulling in one of the modules pulled in everything.

#6 @westi
7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [10110]) Make scriptaculous use the script-loader properly. Fixes #7642 props codestyling and vladimir_kolesnikov.

Note: See TracTickets for help on using tickets.