Does anyone have some ideas about why the VisualEditor is failing on JS level for us?
Please?..
Thanks in advance.
From: mediawiki-l-bounces(a)lists.wikimedia.org
[mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Victor Danilchenko
Sent: Thursday, March 26, 2015 11:45 AM
To: MediaWiki announcements and site admin list
Subject: [MediaWiki-l] Need help with VisualEditor under MediaWiki 1.24.1
Hi all,
I am trying to set up the Visual Editor on out CentOS 6.6 system running MediaWiki 1.24.1
installation. I have successfully set up Parsoid on a stand-along Ubuntu Trusty node (it
works and retrieves/parses Wiki pages), and ensured that it works; I then checked out the
Visual Editor extension (branch REL1_24) and its submodule, and configured them in
LocalSettings.php:
require_once( "{$IP}/extensions/VisualEditor/VisualEditor.php" );
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVisualEditorParsoidURL = 'http://vdanilchenko-compute.vistaprint.net:8142';
$wgVisualEditorParsoidPrefix = 'corewiki';
I am testing it in the latest Chrome. When I view a page and click on the ‘Edit’ button,
the system redirects to the ‘?veaction=edit’ link, thinks for a little while, shows the
blue progress bar -- and then produced this error in the console (call stack included):
ve.ce.BranchNode.js:234 Uncaught NotFoundError: Failed to execute 'insertBefore'
on 'Node': The node before which the new node is to be inserted is not a child of
this node.
ve.ce.BranchNode.js:234 ve.ce.BranchNode.setupSlugs
ve.ce.ContentBranchNode.js:248 ve.ce.ContentBranchNode.renderContents
ve.ce.ContentBranchNode.js:110 ve.ce.ContentBranchNode.onSplice
ve.ce.BranchNode.js:35 VeCeBranchNode
ve.ce.ContentBranchNode.js:20 VeCeContentBranchNode
ve.ce.ParagraphNode.js:18 VeCeParagraphNode
oojs.jquery.js:868 oo.Factory.create
ve.ce.BranchNode.js:168 ve.ce.BranchNode.onSplice
ve.ce.BranchNode.js:35 VeCeBranchNode
ve.ce.DivNode.js:18 VeCeDivNode
oojs.jquery.js:868 oo.Factory.create
ve.ce.BranchNode.js:168 ve.ce.BranchNode.onSplice
ve.ce.BranchNode.js:35 VeCeBranchNode
ve.ce.DocumentNode.js:19 VeCeDocumentNode
ve.ce.Document.js:19 VeCeDocument
ve.ce.Surface.js:30 VeCeSurface
ve.ui.Surface.js:43 VeUiSurface
ve.ui.DesktopSurface.js:20 VeUiDesktopSurface
ve.init.Target.js:185 ve.init.Target.createSurface
ve.init.mw.Target.js:1325 (anonymous function)
This seems to refer to the error in the following code section in
VisualEditor/lib/ve/src/ce/ve.ce.BranchNode.js:
for ( i in this.getModel().slugPositions ) {
slugNode = doc.importNode( slugTemplate, true );
if ( this.children[i] ) {
this.$element[0].insertBefore( slugNode, this.children[i].$element[0] );
} else {
this.$element[0].appendChild( slugNode );
}
this.slugNodes[i] = slugNode;
}
So I tried dumping the nodes involved – this.$element[0] and slugNode – to the console
(immediately preceding the error message of course), and got the following:
0th child:
<p><span class="hideshow1 ve-ce-textStyleAnnotation
ve-ce-spanAnnotation"><span class=""
id="hidemetextWTRaSupplierDocsZ" about="#mwt7"
typeof="mw:Transclusion"
data-parsoid="{“stx”:”html”,”dsr”:[2025,2111,null,null],”pi”:[[{“k”:”hide
id”,”named”:true,”spc”:[““,”“,”“,”“]},{“k”:”text
id”,”named”:true,”spc”:[““,”“,”“,”“]}]]}"
data-mw="{“parts”:[{“template”:{“target”:{“wt”:”Collapsible
js”,”href”:”./Template:Collapsible_js”},”params”:{“hide
id”:{“wt”:”hidemeWTRaSupplierDocsZ”},”text
id”:{“wt”:”hidemetextWTRaSupplierDocsZ”}},”i”:0}}]}">show</span><span
data-parsoid="{“src”:”<javascript>\n(function($){\n//
$('#hidemeWTRaSupplierDocsZ').css('display','none');\n$('#hidemetextWTRaSupplierDocsZ').text('show').click(function()
{\n $('#hidemeWTRaSupplierDocsZ').slideToggle('fast', function(){\n\n if
($('#hidemeWTRaSupplierDocsZ').is(':hidden')) {\n
$('#hidemetextWTRaSupplierDocsZ').text('show');\n } else {\n
$('#hidemetextWTRaSupplierDocsZ').text('hide');\n }\n\n
});\n})\n})(window.jQuery);\n</javascript>“}"
typeof="mw:Extension/javascript"
data-mw="{“name”:”javascript”,”attrs”:{},”body”:{“extsrc”:”\n(function($){\n//
$('#hidemeWTRaSupplierDocsZ').css('display','none');\n$('#hidemetextWTRaSupplierDocsZ').text('show').click(function()
{\n $('#hidemeWTRaSupplierDocsZ').slideToggle('fast', function(){\n\n if
($('#hidemeWTRaSupplierDocsZ').is(':hidden')) {\n
$('#hidemetextWTRaSupplierDocsZ').text('show');\n } else {\n
$('#hidemetextWTRaSupplierDocsZ').text('hide');\n }\n\n
});\n})\n})(window.jQuery);\n”}}" about="#mwt7">
</span></span><b class="ve-ce-textStyleAnnotation
ve-ce-boldAnnotation">WTR and Supplier Documents</b></p>
Slug:
<span class="ve-ce-branchNode-slug
ve-ce-branchNode-inlineSlug"></span>
Aaaand at this point, I am stuck. These seem to be the DOM nodes dynamically generated by
the Visual Editor, and I have no idea where to go from here.
I am getting this with all the extensions disabled. It happens whether client debugger and
resource loader debug mode are on or off.
Does anyone have any ideas on what might be going wrong?
Thanks!
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l