[wp-trac] [WordPress Trac] #42673: Themes page throws console error when there is only one installed theme

WordPress Trac noreply at wordpress.org
Thu Nov 23 19:23:24 UTC 2017


#42673: Themes page throws console error when there is only one installed theme
------------------------------+--------------------------
 Reporter:  kouratoras        |       Owner:  westonruter
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  4.9.2
Component:  Themes            |     Version:  4.9
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  needs-patch => has-patch commit
 * owner:   => westonruter
 * status:  new => accepted


Comment:

 @afercia looks like you're right. [attachment:42673.diff] does appear to
 fix the issue that [42029] introduced.

 It makes sense why this error is only happening when there is a single
 theme installed because of the condition that short-circuits when there is
 only one theme installed: https://github.com/WordPress/wordpress-
 develop/blob/a687253cce384f6f2e1d921ca6be639431a52e93/src/wp-
 admin/js/theme.js#L96-L99

 When that short-circuit happens, then the `searchView` property never gets
 set, resulting in an error later when it is attempted to be accessed.

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


More information about the wp-trac mailing list