[wp-trac] [WordPress Trac] #23954: Checkbox value is not updated correctly inside media-views.js

WordPress Trac noreply at wordpress.org
Sat Apr 6 14:43:52 UTC 2013


#23954: Checkbox value is not updated correctly inside media-views.js
------------------------------------------------+--------------------------
 Reporter:  NumberKruncher                      |       Owner:
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
Component:  Media                               |  Review
 Severity:  major                               |     Version:  3.5.1
 Keywords:  has-patch dev-feedback 2nd-opinion  |  Resolution:
------------------------------------------------+--------------------------
Changes (by adamsilverstein):

 * keywords:  needs-patch => has-patch dev-feedback 2nd-opinion


Comment:

 thanks for finding that apparent bug and the solution, made my part easy!

 the attached patch ( [attachment:23954.dif 23954.diff] ) includes your
 second correction. i tested and verified that after applying the patch,
 the checkmark works after applying. i think this is a valuable solution,
 but we'll let some more seasoned core developers weigh in on the approach.

 the second issue you describe might be considered normal behavior - when
 you choose the default of any option in the gallery its option name does
 not appear in the shortcode. for example checking order by rand and then
 unchecking, or changing to 4 columns then back to 3, once you are at the
 default value the shortcode value goes away. so if captions are on by
 default there would be no captions="true" in the shortcode at all.

 i noticed the built in random order checkbox uses a value "on" when its
 on, maybe if you go this route the 'false' !== false issue goes away - you
 just test for 'on' otherwise assume its off?

 i wasn't familiar with the !! operator: its taking the value and returning
 a boolean, explained well [http://stackoverflow.com/questions/9284664
 /double-exclamation-points here]

 creating these patches isn't hard, you should give it a try - your efforts
 will be greatly appreciated!

 start here: http://codex.wordpress.org/Contributing_to_WordPress or here:
 http://make.wordpress.org/core/handbook/ to learn more

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


More information about the wp-trac mailing list