Opened 5 years ago
Closed 4 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: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 2.7 |
| Component: | General | Version: | 2.6 |
| Severity: | major | Keywords: | javascript speed delivery time has-patch |
| 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).
Attachments (1)
Change History (7)
- 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
comment:2
codestyling — 5 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.
comment:3
codestyling — 4 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?
vladimir_kolesnikov — 4 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.

What exactly is the issue here.
I don't quite follow the explanation.
Can we have some example code to show the issue.