⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 251674 in webkit


Ignore:
Timestamp:
Oct 28, 2019, 2:46:29 PM (7 years ago)
Author:
Dewei Zhu
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.

Location:
trunk/Websites/perf.webkit.org
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r251607 r251674  
     12019-10-28  Dewei Zhu  <dewei_zhu@apple.com>
     2
     3        Fix a bug that cannot unhide a platform.
     4        https://bugs.webkit.org/show_bug.cgi?id=203521
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Before this change, the there is no value in POST when 'hidden' checkbox is unchecked.
     9        Then the update will fail because platform_hidden cannot be NULL.
     10
     11        * public/admin/platforms.php: Adapted 'update_boolean_field'.
     12        * public/admin/triggerables.php: Adapted 'update_boolean_field'.
     13        * public/include/admin-header.php: Added 'update_boolean_field' helper function to set explict
     14        boolean value for update.
     15
    1162019-10-25  Dewei Zhu  <dewei_zhu@apple.com>
    217
  • trunk/Websites/perf.webkit.org/public/admin/platforms.php

    r194085 r251674  
    6060    if ($action == 'update') {
    6161        if (update_field('platforms', 'platform', 'name')
    62             || update_field('platforms', 'platform', 'hidden'))
     62            || update_boolean_field('platforms', 'platform', 'hidden'))
    6363            regenerate_manifest();
    6464        else
  • trunk/Websites/perf.webkit.org/public/admin/triggerables.php

    r230666 r251674  
    1414        if (update_field('build_triggerables', 'triggerable', 'name'))
    1515            regenerate_manifest();
    16         else if (update_field('build_triggerables', 'triggerable', 'disabled', Database::to_database_boolean(array_get($_POST, 'disabled'))))
     16        else if (update_boolean_field('build_triggerables', 'triggerable', 'disabled'))
    1717            regenerate_manifest();
    1818        else
  • trunk/Websites/perf.webkit.org/public/include/admin-header.php

    r219093 r251674  
    8484}
    8585
     86function update_boolean_field($table, $prefix, $field_name) {
     87    return update_field($table, $prefix, $field_name, Database::to_database_boolean(array_get($_POST, $field_name)));
     88}
     89
    8690function regenerate_manifest() {
    8791    global $db;
Note: See TracChangeset for help on using the changeset viewer.