WordPress.org

Making WordPress.org

Changeset 6117


Ignore:
Timestamp:
11/13/2017 03:08:41 AM (8 months ago)
Author:
dd32
Message:

Trac Components: Avoid PHP Warning when no tickets exist for a component.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php

    r5743 r6117  
    642642        }
    643643
    644         $open_tickets = array_sum( $this->breakdown_component_type[ $component ] );
     644        $open_tickets = 0;
     645        if ( ! empty( $this->breakdown_component_type[ $component ] ) ) {
     646            $open_tickets = array_sum( $this->breakdown_component_type[ $component ] );
     647        }
    645648        echo '<td class="right"><a href="https://core.trac.wordpress.org/component/' . esc_attr( str_replace( ' ', '+', $component ) ) . '">' . $open_tickets . '</a></td>';
    646649        if ( $history['change'] ) {
Note: See TracChangeset for help on using the changeset viewer.