Topic on Project:Support desk

Cite link doesn't show up in WikiEditor

15
Txantimedia (talkcontribs)

I just installed Mediawiki for a group I'm a member of - http://wiki.vvfh.org/

Special Version shows that the Cite extension if installed.

Here's my system details:

Product Version
MediaWiki 1.29.1
PHP 7.1.9 (apache2handler)
MySQL 5.6.36
ICU 59.1

I've read through the docs and installed what I believe are the necessary extensions, templates, scripts and configuration settings. When I run update.php, I don't get any errors. Everything appears to be working except for two things. The Cancel button returns a 404 (so I disabled that for the time being), and I still don't have a Cite link in the WikEditor toolbar.

I have no idea what to do next. I've tested Cite (using the ref tags, and it works as expected. I just can't seem to get that darn link on the toolbar that calls the templates for the various types of cites (web, news, book, and journal).

I would appreciate any help. Links to tutorials, videos, whatever, that would help me resolve this problem.

AhmadF.Cheema (talkcontribs)
Txantimedia (talkcontribs)

I have the following in my Mediawiki:Gadgets-defintions file:

  • refToolbar[ResourceLoader|default|dependencies=user.options,mediawiki.util,mediawiki.legacy.wikibits]|refToolbar.js
  • refToolbar[ResourceLoader|default|dependencies=user.options,mediawiki.legacy.wikibits]|refToolbar.js
  • refToolbarBase[ResourceLoader|hidden]|refToolbarBase.js

I have the MediaWiki:Gadget-refToolbar.js and MediaWiki:Gadget-refToolbar installed.

I don't know if this is related, but when I search for MediaWiki:Gadget-refToolbar on my wiki, and then click on the reftoolbar link, I get this error at the top of the screen:

**munged**wiki.vvfh.org/extensions/EmbedVideo/classes/media/AudioTransformOutput.php on line 75 Notice: Undefined index: descriptionUrl in **munged**wiki.vvfh.org/extensions/EmbedVideo/classes/media/AudioTransformOutput.php on line 85 Notice: Undefined index: descriptionUrl in **munged**wiki.vvfh.org/extensions/EmbedVideo/classes/media/AudioTransformOutput.php on line 85

That's the first time I've seen that, and the EmbedVideo extension seems to be working normally. However, the video on the RefToolbar page errors out, so there may be some kind of interaction problem there. I doubt it's related to RefToolbar though.

You're welcome to visit the site and see if I have the requisite scripts, templates, and definitions.

Txantimedia (talkcontribs)

Can nobody help me with this? I really need this to be working.

AhmadF.Cheema (talkcontribs)

I thought this issue was resolved too.

  • "... when I search for MediaWiki:Gadget-refToolbar on my wiki, and then click on the reftoolbar link..." - Which "reftoolbar" link are you referring to?
  • If it is MediaWiki:RefToolbar, then I don't see such an error. I assumed you had turned Off display of errors on Wiki pages. Additionally, the MediaWiki namespace shouldn't be used to host content or Wiki help information (as you are doing on the MediaWiki:RefToolbar page), do this on Project or Help namespaces. MediaWiki namespace is used for site interface customizations.
  • "... the video on the RefToolbar page..." - Which video?

Has the original issue of "Cite link doesn't show up in WikiEditor" been resolved?

Txantimedia (talkcontribs)

The MediaWiki:Gadget-refToolbar I referred to can be seen here: http://wiki.vvfh.org/index.php/MediaWiki:Gadget-refToolbar

There is a link, reftoolbar, on that page. When you click on that, it takes you to the MediaWiki:RefToolbar page that you linked to. The reason you don't see an error now, is because I removed the video which was causing the error.

How do I turn on display of errors? I am a total newbie at MediaWiki, and there's a lot I still don't know.

I don't understand what namespaces are.

The video is RefTools.ogv.

No, the issue has not been resolved. I still don't have a Cite link in the WikiEditor. I've traced and retraced my steps, made sure I did everything according to the instructions, but it still doesn't work. From my reading, it appears that the Cite link should "just work" in MediaWiki 1.29, which is what I'm running.

I'm so confused now, I'm about to give up.

I've been trying to figure out how the Parsoid service gets installed on FreeBSD, so I can install VisualEditor, but it's not a port, so I'm not sure what to do.

MediaWiki is a great piece of software, but the instructions are written for programmers. I am not a programmer. I can read code and understand basically what's going on, but the details escape me.

AhmadF.Cheema (talkcontribs)

If you don't know about Namespaces, then read about them Manual:Namespace, Help:Namespaces.

Your MediaWiki:RefToolbar page should be located at Project:RefToolbar. Also change the link to it at MediaWiki:Gadget-refToolbar.

There is just so much useless content that you have imported that it is difficult to see exactly what is causing the problem. Instead of copy/pasting entire pages first try to have some idea of what is going on.

For example, in your MediaWiki:Gadgets-definition page, have your really imported all the gadgets defined there? And in your MediaWiki:Common.js page, what was the need to import all of it from Wikipedia? This is causing errors, in order to get to the root of the issue, remove the content from this page.

Additionally, it appears that the code you have used for MediaWiki:Gadget-refToolbar.js (from w:Wikipedia:RefToolbar/2.0/porting) has syntax errors that no one happened to catch. Use the code from this old revision, and try again.

Also, from where did you download Extension:EmbedVideo, in previous versions it had incompatibility issues with Extension:Cite. Try removing EmbedVideo from your LocalSettings.php and see if the issue persists.

AhmadF.Cheema (talkcontribs)

@TheDJ can you take another look at w:Wikipedia:RefToolbar/2.0/porting.

The lines near the end, appear to have a couple of typos related to brackets. If I'm not mistaken the following,

if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
	$( function() {
		mw.loader.using( ['user.options'] ).done( initializeRefTools ) );
	}
}
 
}( mediaWiki, jQuery ) );

should be,

if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
	$( function() {
		mw.loader.using( ['user.options'] ).done( initializeRefTools ) 
	}
);
}
 
}( mediaWiki, jQuery ) );
TheDJ (talkcontribs)
Txantimedia (talkcontribs)

@AhmadF.Cheema, thanks for your help. I copied the old revision over, and now I have the Cite link plus all the templates. Thanks for your help.

I removed all the content from MediaWiki:Common.js.

I got the Embed Video extension from MediaWiki: Extension:EmbedVideo

Update: Now I've lost the editor entirely. Damn. This is frustrating as hell.

Second update: If I uncheck the Preference for Enable wizards for inserting links, tables as well as the search and replace function, the editor loads, but I have no Cite link.

I'm getting errors in the console:

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (index.php, line 0) http://wiki.vvfh.org/w/index.php?title=User:Cacycle/wikEdDiff.js&action=raw&ctype=text/javascript

[Log] Exception in load-callback in module oojs-ui.styles.icons-content: (load.php, line 13082)

[Error] TypeError: cbButton.setElementId is not a function. (In 'cbButton.setElementId( 'wpCitations' )', 'cbButton.setElementId' is undefined) – TypeError: cbButton.setElementId is not a function. (In 'cbButton.setElementId( 'wpCitations' )', 'cbButton.setElementId' is undefined)

TypeError: cbButton.setElementId is not a function. (In 'cbButton.setElementId( 'wpCitations' )', 'cbButton.setElementId' is undefined)addCitationButton — load.php:40(anonymous function) — load.php:3305fire — load.php:3148fireWith — load.php:3260(anonymous function) — load.php:3350(anonymous function) — load.php:12358handlePending — load.php:11417markModuleReady — load.php:11631(anonymous function) — load.php:11667fire — load.php:3148add — load.php:3194always — load.php:3295runScript — load.php:11659checkCssHandles — load.php:11707(anonymous function) — load.php:11717fire — load.php:3148fireWith — load.php:3260fire — load.php:3267fireCallbacks — load.php:11280addEmbeddedCSS — load.php:11319(anonymous function) — load.php:11304

logError (load.php:13088)

handler (load.php:10965)

fire (load.php:3148)

fireWith (load.php:3260)

fire (load.php:3267)

track (load.php:10941)

handlePending (load.php:11423)

markModuleReady (load.php:11631)

(anonymous function) (load.php:11667)

fire (load.php:3148)

add (load.php:3194)

always (load.php:3295)

runScript (load.php:11659)

checkCssHandles (load.php:11707)

(anonymous function) (load.php:11717)

fire (load.php:3148)

fireWith (load.php:3260)

fire (load.php:3267)

fireCallbacks (load.php:11280)

addEmbeddedCSS (load.php:11319)

(anonymous function) (load.php:11304)

When I enable the wizards, I get this in the console:

[Error] TypeError: cbButton.setElementId is not a function. (In 'cbButton.setElementId( 'wpCitations' )', 'cbButton.setElementId' is undefined)

addCitationButton (load.php:40)

(anonymous function) (load.php:3305)

fire (load.php:3148)

add (load.php:3194)

(anonymous function) (load.php:3304)

each (load.php:384)

(anonymous function) (load.php:3301)

Deferred (load.php:3361)

then (load.php:3300)

(anonymous function) (load.php:95)

fire (load.php:3148)

fireWith (load.php:3260)

(anonymous function) (mediawiki.action.edit.js:32)

fire (load.php:3148)

fireWith (load.php:3260)

ready (load.php:3472)

completed (load.php:3503)

Txantimedia (talkcontribs)

@AhmadF.Cheema, I added the following to User:Schmehl/common.js and now the editor is working with Cite.

// install User:Cacycle/wikEdDiff enhanced diff mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEdDiff.js&action=raw&ctype=text/javascript' );

My concern now is, does this need to be added to the site common.js file so all users can use the Cite capability?

AhmadF.Cheema (talkcontribs)

As I mentioned previously, you have imported a lot of useless content such as gadgets (as can be see from, MediaWiki:Gadgets-definition page). Gadgets make use of javascript code and if for some reason that code cannot be used, it can cause errors which affect the entire Wiki (like in this case the wikEdDiff gadget).

I suggest that you, aside from the few gadget definitions that you specifically included such as for Extension:Cite, remove all other gadget definitions from your MediaWiki:Gadgets-definition page. and try again.

Txantimedia (talkcontribs)

@AhmadF.Cheema, as I said, the Cite link is working now, and I'm not seeing any errors in the console.

If the documentation was written for admins rather than programmers, it might be a little easier for people like me to set the thing up without running into problems. I had probably read the docs on reftoolbar at least 10 times and checked and rechecked my work repeatedly.

In MediaWiki 1.29, the Cite button should work out of the box with a new install, once the WikiEditor extension has been installed. It doesn't. Not until I added wikEdDiff, did it work correctly. Nowhere in any of the docs I read was there any mention that wikEdDiff is required for the Cite link to work.

I'm a capable admin (I would call myself a journeyman), and this is, without a doubt, the most difficult and frustrating software I have ever installed. I spent hours and hours trying to get it working. Then I decided to switch to VisualEditor, but that requires a parsoid service, which I was unable to get working correctly on FreeBSD (my OS of choice.)

I'm not complaining. I'm giving you input which I hope you will find helpful.

How do I install Gadgets? I have no idea. Where's a list of Gadgets that are available? I have no idea. Rest assured, I've searched for them.

I hope you'll pass this info on to the folks that head up the project and ask them to consider writing documentation for the common man.

AhmadF.Cheema (talkcontribs)

You mentioned something along the lines of "... If I uncheck the Preference for Enable wizards for inserting links, tables as well as the search and replace function, the editor loads, but I have no Cite link." and "does this [User:Cacycle/wikEdDiff] need to be added to the site common.js file so all users can use the Cite capability?"

Because of the above, I assumed that Cite tab is not working as is expected.

The Cite tab is not included by default probably because aside from Wikipedia almost all, if not all, Wikimedia foundation Wikis do not use it. It is an extra feature, those who need it can implement it and those who don't can use the default settings.

As far as I know, wikEdDiff is definitely not needed for the Cite button to work. I personally know a third-party Wiki where it works in the absence of wikEdDiff.

As I mentioned before, what probably happened was that by including wikEdDiff's definition (or some different gadget) in your MediaWiki:Gadgets-definition page, you inadvertently created a call for that gadget's source code. But when that source code was non-existent on your Wiki, it interfered with the normal loading of WikiEditor and threw out some errors. And when you included the missing code for your User:Schmehl page, the errors got resolved and WikiEditor loaded normally.

The method to install gadgets is mentioned on the Extension:Gadgets page and as the page mentions an "overview of the gadgets ... is also shown on Special:Gadgets," For example, list of Wikipedia gadgets can be seen from w:Special:Gadgets.

Additionally, being a volunteer-driven work, a lot of the documentation is not written by the actual developers themselves but by other simple non-dev users. If you can help in making the documentation better, the community will appreciate your contribution.

TheDJ (talkcontribs)

"If the documentation was written for admins rather than programmers, "

That's because it's not for admins honestly. Gadgets are custom, improvised and volunteer written software and they require understanding of how and why they work. If we would have started MediaWiki in 2011 instead of 2001, than Gadgets and scripts would never have been added as a feature to MediaWiki as it is squarely dangerous ! But unfortunately we are stuck with them at the WMF wikis.

This is also why we have so many problems with gadgets on the smaller WMF wikis. You have to understand what you are doing, you have to be able to read the code, and be able to debug and maintain it.