Page MenuHomePhabricator

Deprecate parameter onlyroot
Closed, ResolvedPublic

Description

The parameter onlyroot is deprecated since July 2008 and should replaced by depth="0".
https://www.mediawiki.org/wiki/Extension:CategoryTree

onlyroot: set this to "on" to only show the "root" node of the tree initially. Equivalent to depth="0". (Introduced in r20385, March 13 2007.)
Deprecated as of r36864, July 2008: use depth="0" instead.

Show a deprecation warning message if the parameter is still used.

Event Timeline

Change 715704 had a related patch set uploaded (by Fomafix; author: Fomafix):

[mediawiki/extensions/CategoryTree@master] Show a deprecation warning if parameter onlyroot is used

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

The parameter onlyroot is deprecated since July 2008 and should replaced by depth="0".

According to what commit is it deprecated? This seems to be like a shortcut, which takes 1 line of code to implement, a line that hasn't changed since 2007 with https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CategoryTree/+/ad82c9e7d77251cb60aef13f4fb9042dad0a2254%5E%21/CategoryTree.php.

I would suggest leaving it as-is, instead of requiring migration and overhead and risk and churn, as well as upgrade complexity for third-party installations where there is no database migration provided. While we liberally deprecate and break things between developer interfaces (arguably more than we should), we don't generally liberally deprecate and break the way wikitext itself works.

What cost are we trading?
What is the benefit?

According to what commit is it deprecated?

The deprecation of onlyroot is documented on https://www.mediawiki.org/wiki/Extension:CategoryTree since July 2008 (https://www.mediawiki.org/w/index.php?title=Extension:CategoryTree&diff=prev&oldid=198438). This is the official documentation.

According to what commit is it deprecated?

The deprecation of onlyroot is documented on https://www.mediawiki.org/wiki/Extension:CategoryTree

That page points to https://static-codereview.wikimedia.org/MediaWiki/36864.html, which appears unrelated. This was added in edit https://www.mediawiki.org/w/index.php?title=Extension:CategoryTree&diff=next&oldid=196664.

[…]
What cost are we trading?
What is the benefit?

What cost are we trading?
What is the benefit?

Deprecating and removing old unused superseded redundant things is always additional work. It is easy to introduce new features but removing features is difficult.
The feature onlyroot was superseded by the generalized feature depth="0" after about one year and is now deprecated since 16 years. But only soft deprecated because is generates no warning. https://gerrit.wikimedia.org/r/715704 starts a hard deprecation phases for onlyroot.

It appears to have ~140 uses on public Wikimedia wikis. I don't have metrics on third-party MediaWiki sites. To my knowledge, we have no process for how we would help third-parties upgrade. To my knowledge, we've never really removed capabilities from wikitext in this way before, especially not inside an extension. I'd probably expect update.php to make some kind of indication. And automatic migration is almost certainly not possible, given how templates and gadgets can operate beyond trivial ability to detect and update usage in-place.

https://global-search.toolforge.org/?q=onlyroot%3D&namespaces=&title=

When it comes to wikitext features, I think we need a very good reason to make a breaking change. And if we don't plan to remove it (breaking change), then deprecation seems moot.

I would suggest to leave it as an alias, and edit the one page on mediawiki.org that claims it as deprecated, to no longer claim that.

Formally the removal of the parameter onlyroot is a breaking change, but the impact is just one expanded level of subcategories.

Putting warnings in the content is the normal way for templates to handle deprecations and other errors.

A warning message while update.php would require a parsing of all pages. For large sites this would be a bad process.

A tracking category is an interesting additional deprecation warning and tracking.

MediaWiki should have a well-known process for wikitext deprecations like this.

Change #715704 merged by jenkins-bot:

[mediawiki/extensions/CategoryTree@master] Show a deprecation warning if parameter onlyroot is used

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

Change #1064009 had a related patch set uploaded (by Fomafix; author: Fomafix):

[mediawiki/extensions/CategoryTree@master] Add link to T290062 on onlyroot deprecation message

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

Change #1064009 merged by jenkins-bot:

[mediawiki/extensions/CategoryTree@master] Add link to T290062 on onlyroot deprecation message

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