Ticket #7642 (new defect)

Opened 3 months ago

Last modified 1 month ago

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

Reported by: codestyling Assigned to: anonymous
Priority: normal Milestone: 2.8
Component: General Version: 2.6
Severity: normal Keywords: reporter-feedback
Cc:

Description

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:

wp_enqueue_script('scriptaculous-effects');

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

Solution: 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).

Change History

10/15/08 21:05:14 changed by westi

  • keywords changed from scripting scriptaculous bug to reporter-feedback.
  • priority changed from high to normal.
  • severity changed from major to normal.
  • milestone changed from 2.7 to 2.8.

What exactly is the issue here.

I don't quite follow the explanation.

Can we have some example code to show the issue.

10/18/08 16:57:51 changed by codestyling

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.