Making WordPress.org


Ignore:
Timestamp:
09/06/2015 06:19:05 PM (9 years ago)
Author:
ocean90
Message:

Rosetta: Avoid PHP notices if a project has no sub-projects.

see #1101.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php

    r1792 r1864  
    476476        usort( $project_tree, array( $this, '_sort_name_callback' ) );
    477477        foreach ( $project_tree as $key => $project ) {
    478             if ( $project->sub_projects ) {
     478            if ( isset( $project->sub_projects ) ) {
    479479                usort( $project->sub_projects, array( $this, '_sort_name_callback' ) );
     480                $project->sub_projects = array_values( $project->sub_projects );
    480481            }
    481             $project->sub_projects = array_values( $project->sub_projects );
    482482        }
    483483        $project_tree = array_values( $project_tree );
Note: See TracChangeset for help on using the changeset viewer.