Fixed saving survey data
authorjond@apple.com <jond@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2017 18:18:11 +0000 (18:18 +0000)
committerjond@apple.com <jond@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2017 18:18:11 +0000 (18:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168730

Reviewed by Joseph Pecoraro.

* wp-content/themes/webkit/functions.php:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212899 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/webkit.org/ChangeLog
Websites/webkit.org/wp-content/themes/webkit/functions.php

index 982a813..a1f1bd6 100644 (file)
@@ -1,3 +1,12 @@
+2017-02-23  Jon Davis  <jond@apple.com>
+
+        Fixed saving survey data
+        https://bugs.webkit.org/show_bug.cgi?id=168730
+
+        Reviewed by Joseph Pecoraro.
+
+        * wp-content/themes/webkit/functions.php:
+
 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
 
         Unreviewed, add CSS Grid Layout examples for a blog post.
index 724dae7..460a2b2 100644 (file)
@@ -533,12 +533,14 @@ class WebKit_Nightly_Survey {
             $score[ $SurveyQuestion->question ][ $answer ]++;
         }
 
-        if ($data === false) {
+        if ( $data === false ) {
             $deprecated = null;
             $autoload = 'no';
-            add_option($option, $score, $deprecated, $autoload);
-        } else update_option($option, $score);
-
+            add_option(self::DATA_SETTING_NAME, $score, $deprecated, $autoload);
+        } else {
+            update_option(self::DATA_SETTING_NAME, $score);
+        }
+        
         $httponly = false;
         $secure = false;
         setcookie(self::cookie_name(), 1, time() + YEAR_IN_SECONDS, '/', WP_HOST, $secure, $httponly );