Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28130 closed defect (bug) (fixed)

Saving images after editing media gives a Javascript error

Reported by: t4k1s's profile t4k1s Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version: 2.9
Component: Media Keywords: has-patch needs-testing commit
Focuses: Cc:


Steps to reproduce:
When logged in the dashboard, click on media library, click edit on any image. Rotate, flip, crop or scale the image and press the save button afterwards. In the Javascript console an error appears due to a missing closing div tag.

"SyntaxError: JSON Parse error: Unrecognized token '<' load-scripts.php:39:3922

Attachments (1)

phmi-20140505T1115-wordpress-fix_closingtag.diff (509 bytes) - added by t4k1s 10 years ago.

Download all attachments as: .zip

Change History (4)

#1 @t4k1s
10 years ago

  • Keywords has-patch needs-testing added

#2 @SergeyBiryukov
10 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.0
  • Version changed from trunk to 2.9

The parse error appears to be caused by something else.

I can only reproduce it if manually edit wp_save_image() or wp_save_image_file() to emit some kind of a PHP warning, e.g. to trigger _deprecated_argument(): tags/3.9/src/wp-admin/includes/image-edit.php#L290.

The patch looks good though. The issue was introduced in [11965].

#3 @SergeyBiryukov
10 years ago

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

In 28255:

Fix closing tag in image editor.

props t4k1s.
fixes #28130.

Note: See TracTickets for help on using tickets.