From fbb552b1dffde0905f1af4c0f25bebe8379ef412 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 11 Nov 2022 18:58:48 +0000 Subject: Fix warnings --- autobuild/results.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/autobuild/results.php b/autobuild/results.php index fe1d479..3bbee74 100644 --- a/autobuild/results.php +++ b/autobuild/results.php @@ -224,10 +224,10 @@ function get_build_history($package_id) { function get_package_attributes($package_id) { global $db, $runepoc; if ($package_id) { - # TODO: optimize by retrieving Runs.Id once at the start - $attributes = $db->querySingle("SELECT Attr FROM Attributes, Runs WHERE Runs.Id = Attributes.Run AND Runs.Start = $runepoc AND Attributes.Package = '$package_id';"); + # TODO: optimize by retrieving Runs.Id once at the start + return $db->querySingle("SELECT Attr FROM Attributes, Runs WHERE Runs.Id = Attributes.Run AND Runs.Start = $runepoc AND Attributes.Package = '$package_id';"); } - return $attributes; + return ""; } function get_all_attributes() { @@ -314,11 +314,11 @@ if ($all_attrs) { $filters[$attr_type] = Array(); foreach ($attrs as $attr) { $checked = ""; - if ($_GET["attr_$attr_type_$attr"]) { + if (isset($_GET["attr_${attr_type}_$attr"]) && $_GET["attr_${attr_type}_$attr"]) { $checked = "checked"; array_push($filters[$attr_type], $attr); } - echo "$attr\n"; + echo "$attr\n"; } echo "
\n"; } @@ -327,7 +327,7 @@ if ($all_attrs) { echo "
\n"; $filters["history"] = Array(); $checked = ""; - if ($_GET["history_new"]) { + if (isset($_GET["history_new"]) && $_GET["history_new"]) { $checked = "checked"; array_push($filters["history"], "new"); } echo "Only show newly broken packages
\n"; $filters["status"] = Array(); $checked = ""; - if ($_GET["status_broken"]) { + if (isset($_GET["status_broken"]) && $_GET["status_broken"]) { $checked = "checked"; array_push($filters["status"], "broken"); } @@ -358,6 +358,7 @@ echo "\n"; echo "\n"; foreach ($failure as $rpm => $error) { $parsed = parse_package($rpm); + $packageid = get_package_id($parsed['package']); $attributes = get_package_attributes($packageid); if (isset($pkg_maintainers[$parsed['package']])) { $maintainer = $pkg_maintainers[$parsed['package']]; @@ -384,7 +385,6 @@ foreach ($failure as $rpm => $error) { if (file_exists("icons/error-$error.png")) { $error_html = " $error"; } - $packageid = get_package_id($parsed['package']); $history = get_build_history($packageid); if (is_flaky($history)) { $history_link = $history_link . " "; -- cgit v1.2.1
MaintainerStatusFailure typeBuild stepLanguagesDetected errors