Page MenuHomePhabricator

Automatic citation on Visual Editor doesnt work at trwiki
Closed, ResolvedPublic

Description

Hello,

We've been trying to activate automatic citation on Visual Editor at trwiki for a while, but we couldn't it. I think we did everything right but it gives an error when we try to use it: "We couldn't make a citation for you. You can create one manually using the "Manual" tab above."

I'll be happy if you can help us.

Event Timeline

I've seen this on cywiki as well, after other users reported it. Some sites are able to return an automatic citation e.g. bbc.co.uk/news and guardian.co.uk. I tried news articles from cnn.com and golwg.360.cymru and they didn't work.

I then tried those same articles using enwiki and it worked correctly there. They picked up correct publishing dates from the meta tags so those second sites are working correctly.

I've seen this on cywiki as well, after other users reported it. Some sites are able to return an automatic citation e.g. bbc.co.uk/news and guardian.co.uk. I tried news articles from cnn.com and golwg.360.cymru and they didn't work.

I then tried those same articles using enwiki and it worked correctly there. They picked up correct publishing dates from the meta tags so those second sites are working correctly.

Could you create a new task for this, as each language wiki has its own configuration?

Hello, I've temporarily disabled the message here: https://tr.wikipedia.org/w/index.php?title=MediaWiki:Citoid-template-type-map.json&diff=prev&oldid=22907352

The problem is that each of the templates you list there needs to have Template Data.

The first template I checked there did not have any template data at all, so it will not work for those: https://tr.wikipedia.org/w/index.php?title=%C5%9Eablon:Kaynak/belge

There are some directions here:
https://www.mediawiki.org/wiki/Citoid#Ensure_each_template_to_be_used_in_MediaWiki:Citoid-template-type-map.json_has_an_'citoid'_maps_value

I added TemplateData to all the templates listed in Citoid-template-type-map.json, but it still seems to not work. Do I have to wait a bit or did I do something wrong? Can you check?

I added TemplateData to all the templates listed in Citoid-template-type-map.json, but it still seems to not work. Do I have to wait a bit or did I do something wrong? Can you check?

The template data is not finished, it needs to have a "maps" value for citoid, if you search for 'citoid' here this is no result:. https://tr.wikipedia.org/w/index.php?title=%C5%9Eablon:Web_kayna%C4%9F%C4%B1/belge&action=edit

There is more info about what goes into 'maps' here too: https://www.mediawiki.org/wiki/Citoid/Maps_TemplateData

https://tr.wikipedia.org/w/index.php?title=%C5%9Eablon:Akademik_dergi_kayna%C4%9F%C4%B1/belge&action=edit&section=1 has one, you can check it by searching the template data for 'citoid'.

So for Kaynak, the equivalient might be from https://en.wikipedia.org/wiki/Template:Citation/doc, where it's the following. Obviously the right side needs to be translated into the correct parameters.

https://www.mediawiki.org/wiki/Citoid#Ensure_each_template_to_be_used_in_MediaWiki:Citoid-template-type-map.json_has_an_'citoid'_maps_value has more examples on en wiki of similar templates.

	"maps": {
		"citoid": {
			"edition": "edition",
			"title": "title",
			"caseName": "title",
			"nameOfAct": "title",
			"url": "url",
			"label": "publisher",
			"company": "publisher",
			"studio": "publisher",
			"network": "publisher",
			"distributor": "publisher",
			"publisher": "publisher",
			"publicationTitle": "work",
			"dictionaryTitle": "work",
			"encyclopediaTitle": "work",
			"bookTitle": "work",
			"date": "date",
			"dateEnacted": "date",
			"dateDecided": "date",
			"accessDate": "access-date",
			"place": "place",
			"ISSN": [
				"issn"
			],
			"ISBN": [
				"isbn"
			],
			"PMCID": "pmc",
			"PMID": "pmid",
			"oclc": "oclc",
			"pages": "pages",
			"firstPage": "pages",
			"codePages": "pages",
			"volume": "volume",
			"reporterVolume": "volume",
			"codeVolume": "volume",
			"series": "series",
			"programTitle": "series",
			"episodeNumber": "issue",
			"billNumber": "issue",
			"documentNumber": "issue",
			"publicLawNumber": "issue",
			"docketNumber": "issue",
			"issue": "issue",
			"type": "type",
			"genre": "type",
			"letterType": "type",
			"mapType": "type",
			"DOI": "doi",
			"language": "language",
			"podcaster": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"cartographer": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"interviewee": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"performer": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"programmer": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"sponsor": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"artist": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"director": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"contributor": "others",
			"author": [
				[
					"first",
					"last"
				],
				[
					"first2",
					"last2"
				],
				[
					"first3",
					"last3"
				],
				[
					"first4",
					"last4"
				],
				[
					"first5",
					"last5"
				],
				[
					"first6",
					"last6"
				],
				[
					"first7",
					"last7"
				],
				[
					"first8",
					"last8"
				],
				[
					"first9",
					"last9"
				]
			],
			"translator": [
				[
					"translator-first",
					"translator-last"
				],
				[
					"translator-first2",
					"translator-last2"
				],
				[
					"translator-first3",
					"translator-last3"
				],
				[
					"translator-first4",
					"translator-last4"
				],
				[
					"translator-first5",
					"translator-last5"
				],
				[
					"translator-first6",
					"translator-last6"
				],
				[
					"translator-first7",
					"translator-last7"
				],
				[
					"translator-first8",
					"translator-last8"
				],
				[
					"translator-first9",
					"translator-last9"
				]
			],
			"editor": [
				[
					"editor-first",
					"editor-last"
				],
				[
					"editor2-first",
					"editor2-last"
				],
				[
					"editor3-first",
					"editor3-last"
				],
				[
					"editor4-first",
					"editor4-last"
				]
			]
		}
	}

I was trying to create my first map for the Kaynak template, but I cannot save the page. I review the code and found no errors. The code is here: https://pastebin.com/7uQvyj3x

Could you tell me why I couldn't save and what I did wrong? Thanks.

I was trying to create my first map for the Kaynak template, but I cannot save the page. I review the code and found no errors. The code is here: https://pastebin.com/7uQvyj3x

Could you tell me why I couldn't save and what I did wrong? Thanks.

Ack, you discovered a bug; the problem is that you have some invalid parameters in your map. Except that it doesn't tell you that. At some point error handling for templatedata broke; I've filed a separate bug. Sorry. In the meantime it's really annoying but you would have to check each parameter by hand to make sure it's a valid one. T258790

I have activated VisualEditor by adding ?veaction=edit to the end of the URL and deleted a few parameters that gave the error (like doi parameter) However, noticed some working paramaters also gave errors (like ad2). I'm sure the "ad2" parameter is working.

Error: "maps.citoid.podcaster" özelliği için geçersiz "ad2" parametresi.
Translation: Invalid "ad2" parameter for "maps.citoid.podcaster" feature.

Is this a bug too or something else?

I have activated VisualEditor by adding ?veaction=edit to the end of the URL and deleted a few parameters that gave the error (like doi parameter) However, noticed some working paramaters also gave errors (like ad2). I'm sure the "ad2" parameter is working.

Error: "maps.citoid.podcaster" özelliği için geçersiz "ad2" parametresi.
Translation: Invalid "ad2" parameter for "maps.citoid.podcaster" feature.

Is this a bug too or something else?

ad2 needs to be defined in your template data as a param. Right now there is no parameter for it in the template data itself. (it does not know what the actual parameters of the template are, only what is defined in the template data as a "param".)

Despite all the mishaps, I finally save it. Can you verify that I'm doing it right?

https://tr.wikipedia.org/w/index.php?title=Şablon%3AKaynak%2Fbelge&type=revision&diff=22912043&oldid=17915365

And I also have to do the same to other templates from now on. Isn't it?

Despite all the mishaps, I finally save it. Can you verify that I'm doing it right?

https://tr.wikipedia.org/w/index.php?title=Şablon%3AKaynak%2Fbelge&type=revision&diff=22912043&oldid=17915365

And I also have to do the same to other templates from now on. Isn't it?

It looks good to me!

And yes... now the rest of them. Sorry it is so much work and there are bugs :(.

Thanks for the help. I managed to activate Automatic citation on Visual Editor.

I thought it was working but there is a problem. Some links work, some don't.

For example it works when I use this link: https://www.hurriyet.com.tr/kelebek/keyif/tiyatroya-adanmis-50-yil-tuncer-cucenoglu-41566796
But it doesn't work when I use it: https://www.nytimes.com/2020/07/28/science/nasa-jezero-perseverance.html

What did I do wrong?

I thought it was working but there is a problem. Some links work, some don't.

For example it works when I use this link: https://www.hurriyet.com.tr/kelebek/keyif/tiyatroya-adanmis-50-yil-tuncer-cucenoglu-41566796
But it doesn't work when I use it: https://www.nytimes.com/2020/07/28/science/nasa-jezero-perseverance.html

What did I do wrong?

Nytimes is a news article so there's probably a problem with the template data for the template you're using for newspaperArticle. Hard for me to check right now on mobile what the specific issue is but if it has a maps already, you can try a null edit on the template page to get it to go through.

I couldn't find out what the problem was caused by. I would appreciate it if you review it at a convenient time.

I couldn't find out what the problem was caused by. I would appreciate it if you review it at a convenient time.

This seems to be working now - are they any other problems?

Yes, its working now. There is no other problem.