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

WordPress Trac noreply at wordpress.org
Sun Jun 26 09:28:59 UTC 2016


#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
Component:  Editor                               |  Review
 Severity:  normal                               |    Version:  4.5.3
  Focuses:  javascript, administration,          |   Keywords:
  template                                       |
-------------------------------------------------+-------------------------
 When using the visual composer (wp-admin/customize.php) sometimes it
 simply does not work and throws the error:

 {{{
 data.defaultValue.substring( 0, 1 ) it's not a function
 }}}

 I fixed it by replacing:

 {{{
 public function content_template() {
                 ?>
                 <#
                 var defaultValue = '';
                 if(data.defaultValue)
                 {

 }}}

 with:

 {{{
 public function content_template() {
                 ?>
                 <#
                 var defaultValue = '';
                 if(data.defaultValue && data.defaultValue.length>0)
                 {

 }}}

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


More information about the wp-trac mailing list