Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 5 years ago

#19524 closed defect (bug) (fixed)

Script Loader dies in 3.3 on no-JSON PHP

Reported by: mitchoyoshitaka's profile mitchoyoshitaka Owned by: nacin's profile nacin
Milestone: 3.3.1 Priority: highest omg bbq
Severity: blocker Version: 3.3
Component: General Keywords: has-patch
Focuses: Cc:

Description

As of r18464, the script loader uses json_encode, but for those machines which for some bizarre reason don't build JSON support into PHP (cf #18015), a load-scripts.php request will die.

This happened to me on the released 3.3.

Attachments (5)

19524.diff (383 bytes) - added by mitchoyoshitaka 13 years ago.
19524.2.diff (418 bytes) - added by nacin 13 years ago.
hotfix-patch.diff (3.0 KB) - added by markjaquith 13 years ago.
hotfix-patch.2.diff (3.4 KB) - added by markjaquith 13 years ago.
Updated with proposed (untested) fix for #19510
19524.3.diff (1.3 KB) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (17)

#1 @nacin
13 years ago

  • Component changed from Gallery to General
  • Milestone changed from Awaiting Review to 3.3.1
  • Priority changed from normal to highest omg bbq
  • Severity changed from normal to blocker

#2 @mitchoyoshitaka
13 years ago

Note: it's possible that there are other corners of the code where JSON has been added since 3.3 and compat.php isn't included, but I just haven't stumbled into them yet. It would be worth doing a sweep.

Last edited 13 years ago by mitchoyoshitaka (previous) (diff)

#3 follow-up: @nacin
13 years ago

Patch for hotfix. By defining SCRIPT_DEBUG, load-scripts.php is bypassed. Untested.

Index: hotfix.php
===================================================================
--- hotfix.php	(revision 474276)
+++ hotfix.php	(working copy)
@@ -34,6 +34,9 @@
 	$hotfixes = array();
 
 	switch ( $wp_version ) {
+		case '3.3' :
+			define( 'SCRIPT_DEBUG', true );
+			break;
 		case '3.1.3' :
 			$hotfixes = array( '313_post_status_query_string' );
 			break;

#4 in reply to: ↑ 3 @mitchoyoshitaka
13 years ago

Replying to nacin:

Patch for hotfix. By defining SCRIPT_DEBUG, load-scripts.php is bypassed. Untested.

Tested. Works.

@nacin
13 years ago

#5 follow-up: @nacin
13 years ago

Patch for 3.3.1.

#6 in reply to: ↑ 5 @mitchoyoshitaka
13 years ago

Replying to nacin:

Patch for 3.3.1.

Tested. Works.

@markjaquith
13 years ago

Updated with proposed (untested) fix for #19510

#7 @Ipstenu
13 years ago

FYI, that means "Please install http://wordpress.org/extend/plugins/hotfix/ if you have this problem, until 3.3.1 comes out." ;)

#8 @nacin
13 years ago

In [19597]:

Define json_encode() in load-scripts.php. see #19524 for trunk.

#9 @nacin
13 years ago

After 3.2's JSON snafu, we asked the kind folks at VaultPress to provide some stats on how many installs really don't have JSON compiled. It ended up being a staggering 3.64%, and forced our hand on 3.2.1.

As of yesterday, the number now is 1.25%.

However, we realized today that the number includes PHP4 installs. So the vast majority of these percentages actually include PHP4 on WP 3.1.x. Just two VaultPress sites are PHP 5.2 but missing json. Both appear custom-compiled, so there's no host for us to contact.

That doesn't make this fix any less invalid, but given Hotfix, it should make us feel better about waiting for a 3.3.1.

@nacin
13 years ago

#10 @nacin
13 years ago

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

In [19637]:

Define json_encode() in load-scripts.php. fixes #19524 for 3.3.

This ticket was mentioned in Slack in #core by helen. View the logs.


9 years ago

This ticket was mentioned in Slack in #core-php by sergey. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.