[wp-trac] [WordPress Trac] #7509: Fix up some Notice's in admin

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 13 09:13:01 GMT 2008


#7509: Fix up some Notice's in admin
---------------------+------------------------------------------------------
 Reporter:  DD32     |       Owner:  anonymous
     Type:  defect   |      Status:  new      
 Priority:  normal   |   Milestone:  2.7      
Component:  General  |     Version:  2.7      
 Severity:  normal   |    Keywords:  has-patch
---------------------+------------------------------------------------------
 Attached patch silences a lot of errors with the adition of isset()'s and
 use of temporary variables.

 A special note needs to be given to wp-includes/taxonomy.php, A 'return
 null' was replaced with a WP_Error return value, The function allready
 returns a WP_Error on the next line for a different error condition, so it
 shouldnt break any code, But it may need to be replaced with a null again.

 Affected code is about line 300:
 {{{
         if ( empty($term) ) {
                 return null;
 }}}
 Replaced with:
 {{{
         if ( empty($term) ) {
                 $error = new WP_Error('invalid_term', __('Empty Term'));
                 return $error;
         }
 }}}
 Could also be replaced with:
 {{{
         if ( empty($term) ) {
                 $error = null;
                 return $error;
         }
 }}}
 (Only variables can be returned by reference, returning null or new
 WP_Error directly causes a notice)

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7509>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list