Page MenuHomePhabricator

Add a "hierarchy" type to the Cargo extension
Closed, ResolvedPublic

Description

The Cargo extension (https://www.mediawiki.org/wiki/Extension:Cargo) lets you declare a certain field as having "allowed values" (like "Blue, Red, Yellow"), but it doesn't allow for defining a field as holding a hierarchy of values. An example would be a field called "Topic", which can hold both major topics and minor sub-topics as values.

As I see it, the steps of such a project may look something like:

  • Add support for declaring hierarchy fields
  • Add support for querying hierarchy fields, using a new Cargo keyword, "WITHIN" (as in "where=City WITHIN 'Asia'"). This would need to work with both single-value fields and fields that hold multiple values.
  • Add support for such fields within Cargo's Special:Drilldown interface - a line there might look like:

    Fruits (23) * Vegetables (30) ("Vegetables" only (3) * Root vegetables (15) ("Root vegetables" only (1) * Carrots (12) * Turnips (2) ) * Peppers (12) )
  • Add support for hierarchy fields in the Page Forms extension - so that such fields automatically get the right input type ("tree"), with the right values filled in
  • Also make hierarchy fields easy to create in Page Forms' helper pages, like Special:CreateTemplate and Special:CreateClass

Internship project details

  • Primary mentor: Nischay Nahata (@Nischayn22)
  • Co-mentor: Yaron Koren (@Yaron_Koren), Tobias Oetterer (@Oetterer)
  • Skills: PHP, SQL
  • Estimated project time for a senior contributor: 2 weeks
  • Microtasks:
    • T29702 (may no longer be valid - this should be checked)
    • T72704 (also may no longer be valid)

Event Timeline

@srishakatux - we would very much like to make this a "Featured", official project. What is needed to get it to that point?

@Yaron_Koren thanks for your interest in mentoring this task. Adding it on the MW GSOC page now. It would be great if you could link a few meaningful microtasks from the task description.

Okay, I'll look into that - thanks.

@srishakatux @Aklapper @Yaron_Koren @Nischayn22 @Oetterer , I have submitted a final copy of proposal for this project on GSOC Dashboard. Here is the link to copy of same PDF as asked on Google GSOC Dashboard.

Thank you @Yaron_Koren and @Nischayn22 for reviewing my proposal and providing valuable feedback.

Change 356901 had a related patch set uploaded (by Fz-29; owner: Fz-29):
[mediawiki/extensions/Cargo@master] Added Hierarchy option to #cargo_declare in order to complete the first step in the task T161034.

https://gerrit.wikimedia.org/r/356901

Change 356928 had a related patch set uploaded (by Fz-29; owner: Fz-29):
[mediawiki/extensions/PageForms@master] Added support for hierarchy fields in the Page Forms extension. Hierarchy fields automatically get the right input type ("tree"), with the right values filled in. According to the task T161034.

https://gerrit.wikimedia.org/r/356928

Change 356901 had a related patch set uploaded (by Nemo bis; owner: Fz-29):
[mediawiki/extensions/Cargo@master] Added Hierarchy option to #cargo_declare

https://gerrit.wikimedia.org/r/356901

Change 356901 had a related patch set uploaded (by Fz-29; owner: Fz-29):
[mediawiki/extensions/Cargo@master] Added Hierarchy option to #cargo_declare in order to complete the first step in the task T161034.

https://gerrit.wikimedia.org/r/356901

Yaron_Koren claimed this task.

Resolved a few months ago!