Incorrect value type when using the legacy MySQL extension
authorAlexander Ebert <ebert@woltlab.com>
Sat, 31 Jul 2021 09:46:23 +0000 (11:46 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 31 Jul 2021 09:46:23 +0000 (11:46 +0200)
ts/WoltLabSuite/Core/Ui/Reaction/Handler.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js

index e4e54a4b260fdd2853ced31791979f53afdd882a..f32c893b8d76f00b399b20571c3b0b34df1c6913 100644 (file)
@@ -43,7 +43,7 @@ interface ElementData {
 
 interface AjaxResponse {
   returnValues: {
-    objectID: number;
+    objectID: number | string;
     objectType: string;
     reactions: ReactionStats;
     reactionTypeID: number;
@@ -482,9 +482,10 @@ class UiReactionHandler {
   }
 
   _ajaxSuccess(data: AjaxResponse): void {
-    this.countButtons.updateCountButtons(data.returnValues.objectID, data.returnValues.reactions);
+    const objectId = ~data.returnValues.objectID;
+    this.countButtons.updateCountButtons(objectId, data.returnValues.reactions);
 
-    this._updateReactButton(data.returnValues.objectID, data.returnValues.reactionTypeID);
+    this._updateReactButton(objectId, data.returnValues.reactionTypeID);
   }
 
   _ajaxSetup(): ReturnType<AjaxCallbackSetup> {
index f7758c8181d8a06bc14babfd843f5344ecc444f7..e7482243b4bfe4543ee6f76662f8d245d0681e6d 100644 (file)
@@ -364,8 +364,9 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Dom/Ch
             this._closePopover();
         }
         _ajaxSuccess(data) {
-            this.countButtons.updateCountButtons(data.returnValues.objectID, data.returnValues.reactions);
-            this._updateReactButton(data.returnValues.objectID, data.returnValues.reactionTypeID);
+            const objectId = ~data.returnValues.objectID;
+            this.countButtons.updateCountButtons(objectId, data.returnValues.reactions);
+            this._updateReactButton(objectId, data.returnValues.reactionTypeID);
         }
         _ajaxSetup() {
             return {