Title: [251674] trunk/Websites/perf.webkit.org
Revision
251674
Author
dewei_...@apple.com
Date
2019-10-28 14:46:29 -0700 (Mon, 28 Oct 2019)

Log Message

Fix a bug that cannot unhide a platform.
https://bugs.webkit.org/show_bug.cgi?id=203521

Reviewed by Ryosuke Niwa.

Before this change, the there is no value in POST when 'hidden' checkbox is unchecked.
Then the update will fail because platform_hidden cannot be NULL.

* public/admin/platforms.php: Adapted 'update_boolean_field'.
* public/admin/triggerables.php: Adapted 'update_boolean_field'.
* public/include/admin-header.php: Added 'update_boolean_field' helper function to set explict
boolean value for update.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (251673 => 251674)


--- trunk/Websites/perf.webkit.org/ChangeLog	2019-10-28 21:42:43 UTC (rev 251673)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2019-10-28 21:46:29 UTC (rev 251674)
@@ -1,3 +1,18 @@
+2019-10-28  Dewei Zhu  <dewei_...@apple.com>
+
+        Fix a bug that cannot unhide a platform.
+        https://bugs.webkit.org/show_bug.cgi?id=203521
+
+        Reviewed by Ryosuke Niwa.
+
+        Before this change, the there is no value in POST when 'hidden' checkbox is unchecked.
+        Then the update will fail because platform_hidden cannot be NULL.
+
+        * public/admin/platforms.php: Adapted 'update_boolean_field'.
+        * public/admin/triggerables.php: Adapted 'update_boolean_field'.
+        * public/include/admin-header.php: Added 'update_boolean_field' helper function to set explict
+        boolean value for update.
+
 2019-10-25  Dewei Zhu  <dewei_...@apple.com>
 
         Add SSL support for peformance dashboard database connection.

Modified: trunk/Websites/perf.webkit.org/public/admin/platforms.php (251673 => 251674)


--- trunk/Websites/perf.webkit.org/public/admin/platforms.php	2019-10-28 21:42:43 UTC (rev 251673)
+++ trunk/Websites/perf.webkit.org/public/admin/platforms.php	2019-10-28 21:46:29 UTC (rev 251674)
@@ -59,7 +59,7 @@
 if ($db) {
     if ($action == 'update') {
         if (update_field('platforms', 'platform', 'name')
-            || update_field('platforms', 'platform', 'hidden'))
+            || update_boolean_field('platforms', 'platform', 'hidden'))
             regenerate_manifest();
         else
             notice('Invalid parameters.');

Modified: trunk/Websites/perf.webkit.org/public/admin/triggerables.php (251673 => 251674)


--- trunk/Websites/perf.webkit.org/public/admin/triggerables.php	2019-10-28 21:42:43 UTC (rev 251673)
+++ trunk/Websites/perf.webkit.org/public/admin/triggerables.php	2019-10-28 21:46:29 UTC (rev 251674)
@@ -13,7 +13,7 @@
     } else if ($action == 'update') {
         if (update_field('build_triggerables', 'triggerable', 'name'))
             regenerate_manifest();
-        else if (update_field('build_triggerables', 'triggerable', 'disabled', Database::to_database_boolean(array_get($_POST, 'disabled'))))
+        else if (update_boolean_field('build_triggerables', 'triggerable', 'disabled'))
             regenerate_manifest();
         else
             notice('Invalid parameters.');

Modified: trunk/Websites/perf.webkit.org/public/include/admin-header.php (251673 => 251674)


--- trunk/Websites/perf.webkit.org/public/include/admin-header.php	2019-10-28 21:42:43 UTC (rev 251673)
+++ trunk/Websites/perf.webkit.org/public/include/admin-header.php	2019-10-28 21:46:29 UTC (rev 251674)
@@ -83,6 +83,10 @@
     return TRUE;
 }
 
+function update_boolean_field($table, $prefix, $field_name) {
+    return update_field($table, $prefix, $field_name, Database::to_database_boolean(array_get($_POST, $field_name)));
+}
+
 function regenerate_manifest() {
     global $db;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to