Page MenuHomePhabricator

Support 'maps' parameter in TemplateData Editor (GUI)
Closed, ResolvedPublic

Assigned To
Authored By
Mvolz
Oct 30 2018, 11:06 AM
Referenced Files
F31693909: Title.PNG
Mar 20 2020, 2:50 PM
F31693904: luaStandaloneEngine.PNG
Mar 20 2020, 2:50 PM
F31693914: import_Cite.PNG
Mar 20 2020, 2:50 PM
F31545924: Extensionsenabled.png
Feb 3 2020, 11:22 AM
F31545571: See No Content.png
Feb 3 2020, 3:55 AM
F31545569: Sucessful Import.png
Feb 3 2020, 3:55 AM
F31545312: Import.png
Feb 2 2020, 9:28 PM
F31545318: Impport error.png
Feb 2 2020, 9:28 PM
Tokens
"Like" token, awarded by Amire80.

Description

NOTE: This project has received fewer contributions and is actively seeking new contributors.

The template data GUI editor does not currently support the editing of the 'maps' parameter.

About Template Data in general:
https://en.wikipedia.org/wiki/Wikipedia:TemplateData

There's a brief mention of how to get to the TemplateData Editor GUI here:
https://en.wikipedia.org/wiki/Wikipedia:TemplateData#Adding_TemplateData

More details on the TemplateData Editor:
https://www.mediawiki.org/wiki/Help:TemplateData#TemplateData_editor

Some references about 'maps' specifically, which is not editable using the TemplateData Editor:

Getting started

  1. Install mediawiki and the templatedata extension locally, as well as the Scribunto extension.
  2. Add some templates to your mediawiki extension - https://en.wikipedia.org/wiki/Template:Cite_journal is a good example to start with. You can export pages from wikipedia and import them into your own mediawiki installation using https://en.wikipedia.org/wiki/Special:Export and then http://dev.wiki.local.wmftest.net:8080/wiki/Special:Import
  3. Try editing template data both manually (in source editing mode) and with the GUI

Understanding maps

I think the easiest way to understand 'maps' it is to see it in action; one way to do this is to install Citoid, which is the main reason we created 'maps' (but it is used by other tools now too, like proveit). An alternative to installing citoid locally is you can try it out on test.wikipedia.org; this is kind of sandbox where you can mess around without installing anything locally. I.e. try using visual editor to cite "http://www.example.com", and then go and edit the template data on https://test.wikipedia.org/wiki/Template:Cite_web and see if you can change the resulting citation. 

Potential Microtasks

Checkout tasks labelled good first task

Mentors: @Mvolz, @Tchanders, @Mooeypoo (only available for answering high-level questions related to the codebase)

Event Timeline

Would any of the task subscribers be interested in mentoring this project for Google-Summer-of-Code (2019) or Outreachy (Round 18)? Could you suggest folks whom we should reach out to about this? View program timeline here.

I don't know enough about the 'map' parameter to consider any behaviors that are needed or any edge cases to say how difficult it is to implement.

Out of a quick view, though, adding a representation to the TemplateData dialog that outputs another piece of JSON should be doable.

The documentation helped but I am still a bit vague on things, so I am not sure if I can mentor this on my own without knowing much much deeper about what "maps" parameter is supposed to do, how deep it goes, what its parts represent, etc.

I don't know enough about the 'map' parameter to consider any behaviors that are needed or any edge cases to say how difficult it is to implement.

Out of a quick view, though, adding a representation to the TemplateData dialog that outputs another piece of JSON should be doable.

The documentation helped but I am still a bit vague on things, so I am not sure if I can mentor this on my own without knowing much much deeper about what "maps" parameter is supposed to do, how deep it goes, what its parts represent, etc.

I wrote the code for the maps parameter so I'm happy to mentor that aspect. I don't have any experience with the GUI side of things though!

@Mvolz Would you still be interested in mentoring the project via upcoming rounds? If so, we can promote the project via mailing lists to see if there is an interest in mentoring for the GUI part.

@Mvolz Would you still be interested in mentoring the project via upcoming rounds? If so, we can promote the project via mailing lists to see if there is an interest in mentoring for the GUI part.

Co-mentor, yes, as but I would definitely need another person as I'm not familiar with the template data gui code Javascript side at all, which is where all the changes would be- only the php side of TemplateData and details the maps parameter. If @Mooeypoo is still game I am as well.

Mvolz renamed this task from Support 'maps' parameter in template data GUI editor to Support 'maps' parameter in TemplateData Editor (GUI).Jan 30 2020, 10:15 AM
Mvolz updated the task description. (Show Details)

Hello @Mvolz thanks for the additional description! I am interested in working on this project,

Please when you say add some templates to your mediawiki extension, how do you mean?

Is there a Separate extension called Mediawiki? or are you referring to the TemplateData Extension?

Also how do I add the Cite_Journal Template? I don't get what I am required to do [ https://en.wikipedia.org/wiki/Template:Cite_journal | here ] to add the template

Lastly I have errors when trying to navigate to the Special:Import Page

Special Export.png (427×1 px, 71 KB)

Clicking on Administrators in the page leads me to the page below

Admin direct.png (670×1 px, 77 KB)

Hello @Mvolz thanks for the additional description! I am interested in working on this project,

Please when you say add some templates to your mediawiki extension, how do you mean?

Is there a Separate extension called Mediawiki? or are you referring to the TemplateData Extension?

No, mediawiki is just the "core" basic software. You have that installed already.
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/core

Also how do I add the Cite_Journal Template? I don't get what I am required to do [ https://en.wikipedia.org/wiki/Template:Cite_journal | here ] to add the template

A template is just a special kind of page. You can export pages as an xml file from wikipedia, so you don't have to create them from scratch, using Special:Export. Just type in Template:Cite_journal into the box to export it. More info about Exporting here: https://www.mediawiki.org/wiki/Help:Export

Lastly I have errors when trying to navigate to the Special:Import Page

Special Export.png (427×1 px, 71 KB)

Clicking on Administrators in the page leads me to the page below

Admin direct.png (670×1 px, 77 KB)

You need to log in as an administrator in your local installation. Are you using vagrant? If so the admin username is Admin and the password vagrant. https://www.mediawiki.org/wiki/MediaWiki-Vagrant#Quick_start

Hello @Mvolz thanks for the additional information, I was able to create a vagrant install of mediawiki, then followed the steps to export the cite journal template

Export with included templates.png (663×1 px, 106 KB)

I try importing locally like below

Import.png (664×1 px, 83 KB)

and I end up with an error message like below

Impport error.png (666×1 px, 125 KB)

When I export without Templates though I have no error, but I don't see the original page content, just some kind of JSON, is this the expected behavior

Sucessful import without template\.png (605×1 px, 86 KB)

After going through https://www.mediawiki.org/wiki/Content_handlers page, I was able to enable missing extensions and import the template page Successfully

Sucessful Import.png (603×1 px, 87 KB)

However I see no content when I navigate to the imported page

See No Content.png (667×1 px, 72 KB)

Is there any other step to see page content

After going through https://www.mediawiki.org/wiki/Content_handlers page, I was able to enable missing extensions and import the template page Successfully

Sucessful Import.png (603×1 px, 87 KB)

However I see no content when I navigate to the imported page

See No Content.png (667×1 px, 72 KB)

Is there any other step to see page content

I think you need https://www.mediawiki.org/wiki/Extension:Scribunto as well to use these templates. Sorry, forgot about that ^-^

No issues @Mvolz . I have the extensions enabled though. Import continued failing until I got all necessary extensions installed

Extensionsenabled.png (670×1 px, 180 KB)

@Tchanders any ideas for good microtasks for this project?

Hi, i am vaibhav. And i would love to work upon this project. Can you help in getting started. I have already Installed mediawiki and the templatedata extension locally, as well as the Scribunto extension.

@Vaibhav_apt Please see the "Getting started" and "Potential microtasks" section in this tasks' description.

Hi, I am Thoby, I am an aspiring gsoc 2020 student and would love to contribute to this project on time. Having read comments I still couldn't find any task under the "pontential tasks" section.

@Thobyv, according to the "potential tasks" section:

Checkout tasks labelled good first task

Hello, I am interested in participating in the project as part of GSoC. I have installed MediaWiki on my device in addition to some other extensions including the required ones for this project and now trying to work around to really get familiar with the codebase. However, I have a problem importing Template:cite_journal

import_Cite.PNG (414×879 px, 21 KB)

as one of these two errors always appear:

Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\mediawiki\extensions\Scribunto\includes\engines\LuaStandalone\LuaStandaloneEngine.php on line 533

luaStandaloneEngine.PNG (182×796 px, 14 KB)

OR

Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\mediawiki\includes\Title.php on line 431

Title.PNG (132×641 px, 8 KB)

although these pointed lines do not seem to contain anything related to this issue even when I tried to track there parameters and returns.
If you are familiar with this issue it would be very helpful if you could give me a hint about it or what I am doing wrong.

Thanks in advance.

Hello, I am interested in participating in the project as part of GSoC. I have installed MediaWiki on my device in addition to some other extensions including the required ones for this project and now trying to work around to really get familiar with the codebase. However, I have a problem importing Template:cite_journal

import_Cite.PNG (414×879 px, 21 KB)

as one of these two errors always appear:

Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\mediawiki\extensions\Scribunto\includes\engines\LuaStandalone\LuaStandaloneEngine.php on line 533

luaStandaloneEngine.PNG (182×796 px, 14 KB)

OR

Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\mediawiki\includes\Title.php on line 431

Title.PNG (132×641 px, 8 KB)

although these pointed lines do not seem to contain anything related to this issue even when I tried to track there parameters and returns.
If you are familiar with this issue it would be very helpful if you could give me a hint about it or what I am doing wrong.

Thanks in advance.

How have you installed mediawiki? Is it LAMP, or are you using vagrant (https://www.mediawiki.org/wiki/MediaWiki-Vagrant)? Just from the error it sounds like you might need to increase the timeout for php on your system. Sometimes the process is fine it just takes a while.

Since this is a pretty general question you may also want to check out irc (https://www.mediawiki.org/wiki/MediaWiki_on_IRC); #wikimedia-tech maybe? @srishakatux do you know a better place to ask?

@AdhamKhatean, if you search on Google, you'll get answers, such as: https://www.mediawiki.org/wiki/Topic:Veh8l4gmryp07fzh

@Gabrielchl - thanks for responding, I came across this solution before I post this comment but for some reason, it did not work for me.

How have you installed mediawiki? Is it LAMP, or are you using vagrant (https://www.mediawiki.org/wiki/MediaWiki-Vagrant)? Just from the error it sounds like you might need to increase the timeout for php on your system. Sometimes the process is fine it just takes a while.

Since this is a pretty general question you may also want to check out irc (https://www.mediawiki.org/wiki/MediaWiki_on_IRC); #wikimedia-tech maybe? @srishakatux do you know a better place to ask?

@Mvolz - Thanks for responding, I am using Xampp. Sorry if this was not the place to ask my question.

*However, this issue started to come out after I installed TemplateStyles extension and, which was causing another error when it was missing. And I was just wondering if this is a common issue.

I will try to change the maximum execution time again maybe I was doing something wrong.
I will keep you updated if something changed.
thanks again :)

I came across this solution before I post this comment but for some reason, it did not work for me.

If possible, tell us what exactly did you try to fix it, if it still doesn't work 2nd try.

It worked! thanks a lot!
I did not restart my server at first so that is why it kept showing me the old value (120s).

Since this is a pretty general question you may also want to check out irc (https://www.mediawiki.org/wiki/MediaWiki_on_IRC); #wikimedia-tech maybe? @srishakatux do you know a better place to ask?

Yes #wikimedia-tech might be the best venue for this or you may reach out on Zulip here https://wikimedia.zulipchat.com/#narrow/stream/220258-gsoc20-outreachy20/topic/Technical.20Support

@Tchanders any ideas for good microtasks for this project?

Good first bugs/microtasks:

(I'll see if we can add to this list with new tasks, and edit this comment accordingly - many of the existing tasks are a bit complex or controversial)

If you decide to pick up a task, please assign it to yourself so that we don't duplicate work. And please reach out with any questions!

Is everything in this project task planned for Google-Summer-of-Code (2020) completed? If yes, please consider closing this task as resolved. If bits and pieces are remaining, you could consider creating a new task and moving them there.

@srishakatux I think we could close this task, since the maps parameter is now supported, and that the outstanding tasks are improvements. I'll leave it to @Mvolz though, as the domain expert!

Mvolz assigned this task to AdhamKhatean.