Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#8505 closed defect (bug) (fixed)

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

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

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 18 years ago.
8505-2.patch (2.6 KB ) - added by azaozz 18 years ago.
alt_fix_using_static.patch (2.0 KB ) - added by sambauers 18 years ago.
Alternative to patch by azaozz using a simple static variable attached
8505-4.patch (1.4 KB ) - added by azaozz 18 years ago.

Download all attachments as: .zip

Change History (7)

#1 @westi
18 years ago

  • Resolutionfixed
  • Status newclosed

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

#2 @azaozz
18 years ago

  • Keywords needs-patch added; BackPress has-patch removed
  • Resolution fixed
  • Status closedreopened

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
18 years ago

@sambauers
18 years ago

Alternative to patch by azaozz using a simple static variable attached

@azaozz
18 years ago

#3 @azaozz
18 years ago

  • Resolutionfixed
  • Status reopenedclosed

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

Note: See TracTickets for help on using tickets.