fix milestone counting bug

This commit is contained in:
Gitea 2019-06-26 10:10:51 +01:00
parent 6dc0e65802
commit 9bf1479d33

View File

@ -39,9 +39,9 @@ $callback=function($issue) use ($nolabelLabel,$nomilestoneLabel){
$issue->removeLabel( $nolabelLabel ); $issue->removeLabel( $nolabelLabel );
} }
//do the no-milestone thing //do the no-milestone thing
if( count($issue->getData()->milestone)==0 && !$issue->hasLabel($nomilestoneLabel) ){ if( !$issue->getData()->milestone && !$issue->hasLabel($nomilestoneLabel) ){
$issue->addLabel( $nomilestoneLabel ); $issue->addLabel( $nomilestoneLabel );
}elseif( count($issue->getData()->milestone)>0 && $issue->hasLabel($nomilestoneLabel) ){ }elseif( $issue->getData()->milestone && $issue->hasLabel($nomilestoneLabel) ){
$issue->removeLabel( $nomilestoneLabel ); $issue->removeLabel( $nomilestoneLabel );
} }
}; };