Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#8505 closed defect (bug) (fixed)

Changes in [9809] to class.wp-scripts.php introduce external dependencies to BackPress

Reported by: sambauers's profile sambauers Owned by: nbachiyski's profile nbachiyski
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.7
Component: I18N Keywords: needs-patch
Focuses: Cc:

Description

[9808] introduced a call to an external JavaScript function "convertEntities" from a BackPress file, class.wp-scripts.php - this creates an external dependancy on the function that resides in wp-admin/admin-header.php

The attached patch puts that function inline inside of class-wp-scripts.php, which removes the external dependancy by internalising the function and also has the added benefit of only loading the function when it is explicitly required.

Attachments (4)

fix_external_dependancy_wp_scripts.patch (1.9 KB) - added by sambauers 14 years ago.
8505-2.patch (2.6 KB) - added by azaozz 14 years ago.
alt_fix_using_static.patch (2.0 KB) - added by sambauers 14 years ago.
Alternative to patch by azaozz using a simple static variable attached
8505-4.patch (1.4 KB) - added by azaozz 14 years ago.

Download all attachments as: .zip

Change History (7)

#1 @westi
14 years ago

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

(In [10086]) Move convertEntities js function into the BackPress scriptloader. Fixes #8505 props sambauers.

#2 @azaozz
14 years ago

  • Keywords needs-patch added; BackPress has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

This is an utility function much like addLoadEvent() that should be loaded before any localized script file. The proper place for it would be in admin-header.php.

Don't think this is a new dependency problem, since loaded scripts may also depend on addLoadEvent() which is not a part of class.wp-scripts.php. The current patch also prints it 5-6 times in the HTML head.

@azaozz
14 years ago

@sambauers
14 years ago

Alternative to patch by azaozz using a simple static variable attached

@azaozz
14 years ago

#3 @azaozz
14 years ago

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

(In [10135]) Fix external dependencies in class.wp-scripts.php, fixes #8505

Note: See TracTickets for help on using tickets.