Skip to content

Commit

Permalink
fix PHP 7.4.1 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fmancardi committed Dec 28, 2019
1 parent 6f5dd3e commit e3c50da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/functions/testproject.class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ public function get_by_prefix($prefix, $addClause = null) {
$condition = "testprojects.prefix='{$safe_prefix}'"; $condition = "testprojects.prefix='{$safe_prefix}'";
$condition .= is_null($addClause) ? '' : " AND {$addClause} "; $condition .= is_null($addClause) ? '' : " AND {$addClause} ";


$result = $this->getTestProject($condition); $rs = $this->getTestProject($condition);
return $result[0]; return $rs != null ? $rs[0] : null;
} }




Expand Down
22 changes: 14 additions & 8 deletions lib/functions/tlTestCaseFilterControl.class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1488,7 +1488,8 @@ private function init_filter_keywords() {
$type_selection = $this->args->{$type}; $type_selection = $this->args->{$type};


// are there any keywords? // are there any keywords?
if (!is_null($keywords) && count($keywords)) { $atLeastOneKW = !is_null($keywords) && count($keywords);
if ($atLeastOneKW) {
$this->filters[$key] = array(); $this->filters[$key] = array();


if (!$selection || !$type_selection || $this->args->reset_filters) { if (!$selection || !$type_selection || $this->args->reset_filters) {
Expand All @@ -1513,14 +1514,19 @@ private function init_filter_keywords() {
$this->filters[$key][$type]['selected'] = $type_selection; $this->filters[$key][$type]['selected'] = $type_selection;
} }


// set the active value to filter if ($atLeastOneKW) {
// delete keyword filter if "any" (0) is part of the selection - regardless of filter mode
if (is_array($this->filters[$key]['selected']) && in_array(0, $this->filters[$key]['selected'])) { // set the active value to filter
$this->active_filters[$key] = null; // delete keyword filter if "any" (0) is part of the selection - regardless of filter mode
if (is_array($this->filters[$key]['selected']) && in_array(0, $this->filters[$key]['selected'])) {
$this->active_filters[$key] = null;
} else {
$this->active_filters[$key] = $this->filters[$key]['selected'];
}
$this->active_filters[$type] = $selection ? $type_selection : null;
} else { } else {
$this->active_filters[$key] = $this->filters[$key]['selected']; $this->active_filters[$key] = $this->filters[$key]['selected'];
} }
$this->active_filters[$type] = $selection ? $type_selection : null;
} }




Expand Down

0 comments on commit e3c50da

Please sign in to comment.