Wctaiwan has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125938

Change subject: Call getAlphadecimal() directly in ThanksHooks
......................................................................

Call getAlphadecimal() directly in ThanksHooks

Relying on UUID::__toString() now triggers a notice, causing
unrelated patches to fail. This patch addresses the issue.

Change-Id: Ia94826a0e600adf8afd5908af75772b596ab8d0a
---
M Thanks.hooks.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks 
refs/changes/38/125938/1

diff --git a/Thanks.hooks.php b/Thanks.hooks.php
index ed0b7ac..024e8e8 100644
--- a/Thanks.hooks.php
+++ b/Thanks.hooks.php
@@ -324,8 +324,10 @@
                $cssActiveClass = 'mw-thanks-flow-thank-link mw-ui-button 
mw-ui-quiet mw-ui-constructive';
                $cssInactiveClass = 'mw-thanks-flow-thanked mw-ui-button 
mw-ui-quiet mw-ui-disabled';
 
+               $uuid = $post->getPostId()->getAlphadecimal();
+
                // User has already thanked for revision
-               if ( $user->getRequest()->getSessionData( 
"flow-thanked-{$post->getPostId()}" ) ) {
+               if ( $user->getRequest()->getSessionData( 
"flow-thanked-{$uuid}" ) ) {
                        return Html::rawElement(
                                'span',
                                array( 'class' => $cssInactiveClass ),
@@ -344,7 +346,7 @@
                                'class' => $cssActiveClass,
                                'href' => '#', // TODO: No-javascript fallback
                                'title' => $tooltip,
-                               'data-post-id' => $post->getPostId()
+                               'data-post-id' => $uuid
                        ),
                        wfMessage( 'thanks-button-thank', $user )->escaped()
                );

-- 
To view, visit https://gerrit.wikimedia.org/r/125938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia94826a0e600adf8afd5908af75772b596ab8d0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Thanks
Gerrit-Branch: master
Gerrit-Owner: Wctaiwan <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to