diff --git a/includes/CommentFormatter.php b/includes/CommentFormatter.php index 8fe799353..fe8aae957 100644 --- a/includes/CommentFormatter.php +++ b/includes/CommentFormatter.php @@ -136,7 +136,19 @@ class CommentFormatter { return $wrapperNode; } - $uneditable = DOMCompat::querySelector( $wrapperNode, 'mw\\:editsection' ) === null; + $uneditable = false; + $wrapperParent = $wrapperNode->parentNode; + if ( + $wrapperParent instanceof Element && + strtolower( $wrapperParent->tagName ) === 'section' + ) { + // Parsoid + $uneditable = $wrapperParent->getAttribute( 'data-mw-section-id' ) < 0; + } else { + // Legacy parser + $uneditable = DOMCompat::querySelector( $wrapperNode, 'mw\\:editsection' ) === null; + } + $headingItem->setUneditableSection( $uneditable ); self::addOverflowMenuButton( $headingItem, $doc, $wrapperNode ); diff --git a/tests/cases/tracked-template/tracked-template-desktop.html b/tests/cases/tracked-template/tracked-template-desktop.html index c78bbf673..6038a8ee0 100644 --- a/tests/cases/tracked-template/tracked-template-desktop.html +++ b/tests/cases/tracked-template/tracked-template-desktop.html @@ -66,8 +66,7 @@ newestComment: { } ] } - ], - "uneditableSection": true + ] }, { "headingLevel": 2, @@ -102,8 +101,7 @@ newestComment: { } ] } - ], - "uneditableSection": true + ] } ] } diff --git a/tests/cases/tracked-template/tracked-template-legacy.html b/tests/cases/tracked-template/tracked-template-legacy.html index e4e9f4d70..9bc552cd3 100644 --- a/tests/cases/tracked-template/tracked-template-legacy.html +++ b/tests/cases/tracked-template/tracked-template-legacy.html @@ -66,8 +66,7 @@ newestComment: { } ] } - ], - "uneditableSection": true + ] }, { "headingLevel": 2, @@ -102,8 +101,7 @@ newestComment: { } ] } - ], - "uneditableSection": true + ] } ] } diff --git a/tests/cases/tracked-template/tracked-template-mobile.html b/tests/cases/tracked-template/tracked-template-mobile.html index 2eaccb7a5..86a2740c6 100644 --- a/tests/cases/tracked-template/tracked-template-mobile.html +++ b/tests/cases/tracked-template/tracked-template-mobile.html @@ -1,10 +1,10 @@ -

How to authenticate to Wikimedia Commons Query Service using OAuth in Python?

+

How to authenticate to Wikimedia Commons Query Service using OAuth in Python?

This page says it's possible to authenticate against the query service using OAuth, but has anyone managed to do so programmatically from Python? If anyone has any working code, in any language, I would appreciate whatever you can share. I've asked the full question including my not-working Python code on StackOverflow: https://stackoverflow.com/questions/65303450/how-to-authenticate-to-wikimedia-commons-query-service-using-oauth-in-python --FrankieRayRobertson (talk) 13:38, 21 December 2020 (UTC)(discussiontools-replybutton)

@Multichill: do you have example code for this / are you using WCQS with python? --Zache (talk) 06:55, 4 January 2021 (UTC)(discussiontools-replybutton)
@Zache: no, would have to look into this. Should be part of Pywikibot if someone figures it out. Did you already file a task in phabricator to add support for https://wcqs-beta.wmflabs.org/ ? Multichill (talk) 18:31, 13 February 2021 (UTC)(discussiontools-replybutton)
-

HTTP 500, server down?

+

HTTP 500, server down?

For me https://wcqs-beta.wmflabs.org/ throws a 500 Internal Server Error:

Problem accessing /oauth/check_login. Reason:
@@ -66,8 +66,7 @@ newestComment: {
 						}
 					]
 				}
-			],
-			"uneditableSection": true
+			]
 		},
 		{
 			"headingLevel": 2,
@@ -102,8 +101,7 @@ newestComment: {
 						}
 					]
 				}
-			],
-			"uneditableSection": true
+			]
 		}
 	]
 }