[wp-trac] Re: [WordPress Trac] #4429: add_option followed by update_option not always working

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 5 19:48:47 GMT 2007


#4429: add_option followed by update_option not always working
--------------------------------------+-------------------------------------
 Reporter:  YellowSwordfish           |        Owner:  markjaquith
     Type:  defect                    |       Status:  assigned   
 Priority:  normal                    |    Milestone:  2.3 (trunk)
Component:  Administration            |      Version:  2.2        
 Severity:  normal                    |   Resolution:             
 Keywords:  add_option update_option  |  
--------------------------------------+-------------------------------------
Changes (by markjaquith):

  * owner:  anonymous => markjaquith
  * status:  new => assigned
  * milestone:  2.4 (future) => 2.3 (trunk)

Comment:

 Subscribe to Comments has been triggering this bug too.  I finally nailed
 down the issue.

 {{{add_option()}}} tries to erase the "notoptions" cache entry for the
 option too early... that is, it performs it before a {{{get_option()}}}
 call.  The {{{get_option()}}} call marks (or re-marks) the option as
 "notoptions" (caches its non-existence).  So now when you call
 {{{update_option()}}}, it thinks the option doesn't exist, so it adds a
 new one.  Patches coming.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4429#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list