Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#22585 closed defect (bug) (fixed)

wp_editor() gives fatal error on front-end

Reported by: itworx's profile itworx Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: major Version: 3.5
Component: Editor Keywords: needs-unit-tests has-patch commit
Focuses: Cc:


Adding wp_editor() to theme front-end gives fatal error when media_buttons are set to true.

Fatal error: Call to undefined function is_upload_space_available() in /home/vds/public_html/clients/client1/web6/web/wp-includes/media.php on line 1274

Attachments (2)

22585.diff (1.4 KB) - added by scribu 12 years ago.
22585.2.diff (451 bytes) - added by georgestephanis 12 years ago.

Download all attachments as: .zip

Change History (13)

#1 @itworx
12 years ago

  • Severity changed from blocker to major

#3 @scribu
12 years ago

  • Keywords reporter-feedback added

What exact version of WP are you using?

#4 @scribu
12 years ago

  • Keywords reporter-feedback removed
  • Milestone changed from Awaiting Review to 3.5

Actually, it doesn't matter; I can reproduce with latest trunk.

#5 @scribu
12 years ago

Caused by [22821].

#6 @scribu
12 years ago

  • Keywords needs-unit-tests needs-patch added

Me thinks we should have a basic unit test for this that just checks if there are any errors, fatal or otherwise, when calling wp_editor() in the front-end.

12 years ago

#7 @scribu
12 years ago

  • Keywords has-patch added; needs-patch removed

#8 @nacin
12 years ago

  • Keywords commit added

This is not going to be easy to unit test, because we load all functions in unit tests. (We *could* create a group of frontend tests that run first.) That said, we should work into our workflows to test wp_editor() and all related media stuff on the frontend.

This was originally fixed in [22497] and obviously [22821] required one last function in the mix.

#9 @ryan
12 years ago

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

In 22840:

Make is_upload_space_available() available for front end page loads. Fixes fatal error when calling wp_editor() from the front end.

Props scribu, itworx
fixes #22585

#10 @georgestephanis
12 years ago

Just rewrote the function for tidyness and so as to not unnecessarily save something into a variable.

#11 @nacin
12 years ago

In 22861:

Make the return of is_upload_space_available() more obvious. props georgestephanis. see #22585.

Note: See TracTickets for help on using tickets.