jenkins-bot has submitted this change and it was merged.

Change subject: In LinkTargetInputWidget, put existence status into LinkCache
......................................................................


In LinkTargetInputWidget, put existence status into LinkCache

Bug: 69886
Change-Id: Ib37ba971c006c0bedc94f3ea9f1185461c9617b5
---
M modules/ve-mw/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWLinkTargetInputWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
index 60df372..9da7fb1 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
@@ -142,16 +142,20 @@
                matchingPages = [],
                disambigPages = [],
                redirectPages = [],
-               titleObj = mw.Title.newFromText( this.value );
+               titleObj = mw.Title.newFromText( this.value ),
+               linkCacheUpdate = {};
 
        for ( index in data ) {
                matchingPage = data[index];
+               linkCacheUpdate[matchingPage.title] = { missing: false, 
redirect: false, disambiguation: false };
                existingPages.push( matchingPage.title );
 
                if ( matchingPage.redirect !== undefined ) {
                        redirectPages.push( matchingPage.title );
+                       linkCacheUpdate[matchingPage.title].redirect = true;
                } else if ( matchingPage.pageprops !== undefined && 
matchingPage.pageprops.disambiguation !== undefined ) {
                        disambigPages.push( matchingPage.title );
+                       linkCacheUpdate[matchingPage.title].disambiguation = 
true;
                } else {
                        matchingPages.push( matchingPage.title );
                }
@@ -164,6 +168,12 @@
                titleObj && ve.indexOf( titleObj.getPrefixedText(), 
existingPages ) !== -1
        );
 
+       if ( !pageExists ) {
+               linkCacheUpdate[this.value] = { missing: true, redirect: false, 
disambiguation: false };
+       }
+
+       ve.init.platform.linkCache.set( linkCacheUpdate );
+
        // External link
        if ( ve.init.platform.getExternalLinkUrlProtocolsRegExp().test( 
this.value ) ) {
                items.push( new OO.ui.MenuSectionItemWidget(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib37ba971c006c0bedc94f3ea9f1185461c9617b5
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to