Making WordPress.org

Changeset 6394


Ignore:
Timestamp:
01/18/2018 04:21:48 AM (7 years ago)
Author:
dd32
Message:

Trac: Don't produce a PHP Warning when there's no tickets in a component.

See #3220.

File:
1 edited

Legend:

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

    r6253 r6394  
    435435        $component_type = $this->breakdown_component_type;
    436436        $component_milestone_type = $this->breakdown_component_milestone_type;
     437        $component_count = isset( $component_type[ $component ] ) ? array_sum( $component_type[ $component ] ) : 0;
    437438
    438439        if ( is_singular() ) {
     
    440441        }
    441442
    442         if ( ! $component_count = array_sum( $component_type[ $component ] ) ) {
     443        if ( ! $component_count ) {
    443444            if ( is_singular() ) {
    444445                echo '<h3>No open tickets!</h3>';
Note: See TracChangeset for help on using the changeset viewer.