[wp-trac] [WordPress Trac] #12997: Call to a member function get_names() on a non-object in user.php

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 14 15:36:28 UTC 2010


#12997: Call to a member function get_names() on a non-object in user.php
--------------------------+-------------------------------------------------
 Reporter:  ipstenu       |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.0
Component:  General       |     Version:  3.0
 Severity:  normal        |    Keywords:     
--------------------------+-------------------------------------------------

Comment(by ryan):

 $wp_roles is created on the fly when certain functions in capabilities.php
 are called.  When there is no current user, such as in the case of cron
 events, $wp_roles does not get created.  Thus the error now that
 count_users() is accessing $wp_roles.  I think we can move instantiation
 of $wp_roles to wp-settings.php along with the other global object
 instances.

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


More information about the wp-trac mailing list