[wp-trac] Re: [WordPress Trac] #8949: WP creates duplicate options

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 16 08:23:42 GMT 2009


#8949: WP creates duplicate options
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  anonymous  
     Type:  defect (bug)       |      Status:  new        
 Priority:  low                |   Milestone:  2.8        
Component:  Optimization       |     Version:  2.7        
 Severity:  minor              |    Keywords:  needs-patch
-------------------------------+--------------------------------------------

Comment(by Denis-de-Bernardy):

 Replying to [comment:9 jamescollins]:
 > Replying to [comment:8 donncha]:
 > > FYI - I think it's a good idea too but will have to be implemented
 carefully. Duplicates certainly exist and if the key value is different we
 have to be careful about which key to delete before adding the UNIQUE
 index.

 For what it's worth, update_option() updates by key rather than by ID, so
 when an option with a dup gets updated, all of those that have the same
 name get updated as well. Thus, deleting all by the one with the highest
 ID works. It's usually how I clean things up.

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


More information about the wp-trac mailing list