[wp-trac] [WordPress Trac] #37174: class-wp-customize-color-control.php fails when data.defaultValue is empty

WordPress Trac noreply at wordpress.org
Mon Aug 14 11:40:19 UTC 2017


#37174: class-wp-customize-color-control.php fails when data.defaultValue is empty
-------------------------------------+-------------------------------------
 Reporter:  andreagobetti            |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Customize                |     Version:  4.5.3
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch reporter-      |     Focuses:  javascript,
  feedback                           |  administration, template
-------------------------------------+-------------------------------------

Comment (by yonivh):

 @westonruter, that fix also works for me.

 The additional info you requested: when I log data.defaultValue in the
 console, it returns nothing. When I use some random print_r/var_dump
 function (https://jsfiddle.net/jaredwilli/jtqNY/) it tells me the variable
 is an empty object. So I've just logged 'data'. Results are below.

 '''This is a child of data which works:'''

 {{{
 {settings: {…}, type: "color", priority: 4, active: true, section:
 "colors", …}
 active
 :
 true
 content
 :
 "<li id="customize-control-border_color" class="customize-control
 customize-control-color">↵                                    </li>"
 defaultValue
 :
 "#dddddd"
 description
 :
 ""
 instanceNumber
 :
 59
 label
 :
 "Border color"
 mode
 :
 "full"
 priority
 :
 4
 section
 :
 "colors"
 settings
 :
 default
 :
 "border_color"
 __proto__
 :
 Object
 statuses
 :
 ""
 :
 "Standaard"
 __proto__
 :
 Object
 type
 :
 "color"
 __proto__
 :
 Object
 }}}


 '''This is a child of data which doesn't work:'''

 {{{
 {settings: {…}, type: "color", priority: 4, active: true, section:
 "colors", …}
 active
 :
 true
 content
 :
 "<li id="customize-control-widget_title_color" class="customize-control
 customize-control-color">↵                                      </li>"
 defaultValue
 :
 Array(0)
 length
 :
 0
 __proto__
 :
 Array(0)
 description
 :
 ""
 instanceNumber
 :
 60
 label
 :
 "Widget title color"
 mode
 :
 "full"
 priority
 :
 4
 section
 :
 "colors"
 settings
 :
 {default: "widget_title_color"}
 statuses
 :
 {"": "Standaard"}
 type
 :
 "color"
 __proto__
 :
 Object
 }}}

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


More information about the wp-trac mailing list