[wp-trac] [WordPress Trac] #26886: wp_enqueue_script doesn't load all scripts

WordPress Trac noreply at wordpress.org
Tue Feb 24 01:20:58 UTC 2015


#26886: wp_enqueue_script doesn't load all scripts
-------------------------------+------------------------------
 Reporter:  alfredocubitos     |       Owner:
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Script Loader      |     Version:  3.8
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by alturic):

 Replying to [comment:18 dd32]:
 > > Yea, that's been my point, it loads perfectly fine if I a.) convert it
 to load[] in the url and b.) put those load[]'s not in the middle of
 script-names. :P
 >
 > Then it kind of sounds like it's working as expected, based on `a)` only
 being needed for testing, and `b)` not understanding how it works.

 Well, and I don't mean this rudely, it works perfectly fine with I
 manually putting the load[]'s in the url NOT in the middle of script-
 names, which is what's happening. Perhaps I didn't make that part clear?
 The actual function is "working", it's just literally inserting the
 additional load[]'s in the middle of script names...

 So for example if jquery-ui-tabs was the script name and the "j" in
 jqeury-ui-tabs was char 120, the function would end up making the query
 string parameter:

 URL:

 {{{
 load%5B%5D=scriptnames,up,to128,chars,jqeury-
 uiload%5B%5D=-tabs,more,scriptnames,pretendthisischar125,thload%5B%5D=iswasbroken,aswell
 }}}

 Query String Parameter:

 {{{
 load[]=scriptnames,up,to120,chars,jqeury-ui
 load[]=-tabs,more,scriptnames,pretendthisischar125,th
 load[]=iswasbroken,aswell
 }}}


 Note the two broken script names in the above.

 Now when things are working correctly it would look like this I'm
 guessing:

 {{{
 load%5B%5D=scriptnames,up,to128,charsload%5B%5D=jqeury-ui-
 tabs,more,scriptnames,pretendthisischar125load%5B%5D=thisnowaworkingscriptname,aswell
 }}}

 Query String Parameter:


 {{{
 load[]=scriptnames,up,to120,chars
 load[]=jquery-ui-tabs,more,scriptnames,pretendthisischar125
 load[]=thisisnowaworkingscript,aswell
 }}}

 Note in the above two it's knowing "hey, we want to goto 128 chars, but we
 don't want to insert additional load[]'s in the middle of script names.

 And that's what I'm saying, the WP function is the one who's concating the
 length at 128, so how would nginx or php be causing it to not be smart (as
 in "finishing" the actual concat function) about the script name as to not
 insert a load[] in the middle of names...

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26886#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list