[wp-trac] [WordPress Trac] #19925: Empty widget title in admin not handled properly

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 28 09:36:43 UTC 2012


#19925: Empty widget title in admin not handled properly
----------------------------+--------------------
 Reporter:  kawauso         |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.4
Component:  Administration  |     Version:  3.3.1
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+--------------------

Comment (by kawauso):

 Replying to [comment:1 mp3j3rk]:
 > Before patching, after a refresh, or navigating away from the page and
 then back to it, the name updates.  Obviously, we would like to see the
 widget's title update immediately after clicking Save.

 That's rather odd. It should be being updated along with the widget saving
 spinner in either case. Perhaps there's a JS conflict on your site or JS
 is disabled?

 > why did you use
 >  {{{if (typeof title != "undefined")}}}
 > instead of something like
 >  {{{if (typeof title == "undefined" || title === null || title ===
 '')}}}

 The initial
   {{{if ( title = title.val() )}}}
 will be true for any case where `title` is a non-empty string, so
   {{{if (typeof title != "undefined")}}}
 just sorts between the two other potential values returned by
 `jQuery.val()`, an empty string and an undefined value when there is no
 title field. In the latter case, we don't want to touch the title at all
 since there is no title value to display (rather than an empty one).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19925#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list