From 0ffae10033d723668f578c3c7047ea1ac183bc79 Mon Sep 17 00:00:00 2001 From: ChlodAlejandro Date: Tue, 20 Sep 2022 09:35:30 +0800 Subject: [PATCH] fix for [[Special:Diff/1111242074]] et al. --- .../ia/models/CopyrightProblemsListing.ts | 21 ++++++++++--------- .../ia/ui/SinglePageWorkflowDialog.tsx | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/modules/ia/models/CopyrightProblemsListing.ts b/src/modules/ia/models/CopyrightProblemsListing.ts index 06bc550d..3ae6484f 100644 --- a/src/modules/ia/models/CopyrightProblemsListing.ts +++ b/src/modules/ia/models/CopyrightProblemsListing.ts @@ -118,17 +118,18 @@ export default class CopyrightProblemsListing { // This ensures we're always using the prefixedDb version of the title (as // provided by the anchor) for stability. const prefixedDb = anchor.getAttribute( 'id' ); - const href = el.getAttribute( 'href' ); const title = anchorToTitle( el as HTMLAnchorElement ); - - if ( title === false ) { - // Not a valid link. - return false; - } else if ( title.getPrefixedText() !== new mw.Title( prefixedDb ).getPrefixedText() ) { - // Anchor and link mismatch. Someone tampered with the template? - // In this case, rely on the link instead, as the anchor is merely invisible. - console.warn( `Anchor and link mismatch for "${title.getPrefixedText()}".`, title, prefixedDb ); - } + + if ( title === false ) { + // Not a valid link. + return false; + } else if ( title.getPrefixedText() !== new mw.Title( prefixedDb ).getPrefixedText() ) { + // Anchor and link mismatch. Someone tampered with the template? + // In this case, rely on the link instead, as the anchor is merely invisible. + console.warn( + `Anchor and link mismatch for "${title.getPrefixedText()}".`, title, prefixedDb + ); + } // Checks for the element. // This ensures that the listing came from {{article-cv}} and isn't just a diff --git a/src/modules/ia/ui/SinglePageWorkflowDialog.tsx b/src/modules/ia/ui/SinglePageWorkflowDialog.tsx index 14ad12bf..e6bd9168 100644 --- a/src/modules/ia/ui/SinglePageWorkflowDialog.tsx +++ b/src/modules/ia/ui/SinglePageWorkflowDialog.tsx @@ -495,7 +495,7 @@ function initSinglePageWorkflowDialog() { const comments = `${ ( from || '' ).trim().length !== 0 ? 'from ' + from + '. ' : '' }${ - this.data.notes + this.data.notes ?? '' }`; await CopyrightProblemsPage.getCurrent()