[wp-trac] [WordPress Trac] #46538: Aligning gallery results in conflicting classes added

WordPress Trac noreply at wordpress.org
Sat Mar 16 07:55:15 UTC 2019


#46538: Aligning gallery results in conflicting classes added
--------------------------------------------+-----------------------------
 Reporter:  janpaulkleijn                   |      Owner:  (none)
     Type:  defect (bug)                    |     Status:  new
 Priority:  normal                          |  Milestone:  Awaiting Review
Component:  Gallery                         |    Version:  5.1
 Severity:  normal                          |   Keywords:  needs-patch
  Focuses:  ui, javascript, administration  |
--------------------------------------------+-----------------------------
 When a gallery is created in the Visual editor it's class is set to
 alignundefined. After it is saved and I view the result it's class has no
 alignment set. So far so good.

 When I close the editing and go back to manage posts list and I reopen the
 same post to be edited the gallery class is still set to alignundefined.
 Still good.

 When I set the alignment to 'Align left' and save the post, the result is
 that the gallery class is set to 'alignleft'. Still good.

 But here it comes: When I close the editing again and go back to manage
 posts list and I reopen the same post to be edited the gallery class is
 now set to 'alignleft alignleft', so twice the same class.

 And from there on, one 'alignleft' class will be staying in the class
 attribute. So if I change the alignment to 'Align center' and save the
 post, the result will be that the class attribute of the <ul> gallery tag
 holds the value 'aligncenter alignleft'.

 This can cause some layout issues, plugin issues etc, etc.

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


More information about the wp-trac mailing list