WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12653 closed defect (bug) (fixed)

Quick edit template dropdown initially blank in Safari

Reported by: sillybean Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Quick/Bulk Edit Keywords:
Focuses: Cc:

Description

In Safari, using quick edit, the template dropdown for pages and hierarchical custom types initially appears with a blank choice. When you pull it down, Default Template is the first option and there is no blank one, but for some reason Default is not showing until you choose it explicitly.

Change History (3)

#1 @nacin
8 years ago

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

(In [13817]) Initialize _wp_page_template for the first page in wp_install_defaults(). fixes #12653, a Webkit/jQuery bug in Quick Edit (see ticket)

#2 @nacin
8 years ago

  • Milestone changed from Unassigned to 3.0

Okay, this one was fun to track down.

_wp_page_template is enforced in wp_insert_post(), but not in the initial install. Hence, when trying to Quick Edit the About page (which I'm betting you were doing), the JS is dealing with a value of , when it should be 'default' or the name of a page template.

(Hypothetically, we should make the nonexistence of _wp_page_template be the same as 'default', but since we enforce it in wp_insert_post(), then it's fine, except when you quick edit the About page prior to saving it.)

Now to the browser bug. Using jQuery, we don't mess with selected attributes, and instead set the value of the select box to whatever the _wp_page_template value is. If an option with that value exists, it works well. In Webkit however (I got this in Chrome as well), we get a select box with no selected option, if the value does not exist. (Such would be the case when is the page template -- it should be 'default'.)

#3 @nacin
8 years ago

Gah, there's two lines of italic text there -- the start of the italics were supposed to be empty strings, ''.

Note: See TracTickets for help on using tickets.