Page MenuHomePhabricator

Broken article categorization due to colon automatically inserted in front of category name
Closed, ResolvedPublicBUG REPORT

Description

At the end of August, when editing articles, the following bug began to appear: when inserting categories, a colon is automatically inserted in front of the category name. As a result, instead of [[Category:Cats]] we have [[:Category:Cats]]. This leads to the article not being categorized. That is why you have to do two extra steps: go back in the text and remove the colon manually, and so with each one of the added categories (!). This is extremely inconvenient.

As far as I understand, to fix the situation, you need to delete text "|| namespaceId === 14" in https://gerrit.wikimedia.org/g/mediawiki/extensions/WikiEditor/+/3ffcdfd1f2571c2b887b1efea70b8524bd0d8cc2/modules/jquery.wikiEditor.dialogs.config.js#360

Event Timeline

Aklapper added a subscriber: happy5214.

Adding the author of e76eba6b9619185cceb094c493aed2207d9d7ad1 which seems to have introduced the current behavior

Aklapper renamed this task from Misbehavior of WikiEditor to Broken article categorization due to colon automatically inserted in front of category name.Sep 12 2021, 1:37 PM

The behaviour was changed to avoid accidentally categorization from a link in a text. The new behaviour seems okay for a feature called "insert link".

I understand why using the link feature to generate categorization, because the generated syntax looks similar, but the semantic is not the same.
Does this need a new dialog? That could also add the category to the end of the page when the cursor is not within the existing category of a page.

The behaviour was changed to avoid accidentally categorization from a link in a text. The new behaviour seems okay for a feature called "insert link".

I understand why using the link feature to generate categorization, because the generated syntax looks similar, but the semantic is not the same.
Does this need a new dialog? That could also add the category to the end of the page when the cursor is not within the existing category of a page.

Due to the specifics of Wikipedia, categories (in an amount of at least 2-5 ones) are placed in each article; and the need to insert them into the article arises much more often than the need to mention category in the discussion or somewhere else. Creating a separate dialog/button to perform the same functionality, which is performed by the "insert link" button, seems to me an unnecessary complication. Although, in the absence of simpler solutions, you can do so.

So far, I see two ways to solve the problem:

  1. Return the functionality as I said in the initial post of the topic
  2. Introduce, if possible, checking the namespace in which the edited text is located. And if this namespace is the main one, then insert the category as a category, not as a link.
Ammarpad added a subscriber: Ammarpad.

This is still a regression since it breaks expected (and correct) behavior. Colon escaping of these links in main namespace is almost always wrong.

Change 720496 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/extensions/WikiEditor@master] Do not add colon link escape in main namespace

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

e76eba6b9619185cceb094c493aed2207d9d7ad1 was a fix for T38227. If you revert that commit with the above patch, please either reopen that task or mark it as invalid.

Change 720496 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Revert \"Support colon link escapes for categories and files\"

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

happy5214 assigned this task to Ammarpad.
happy5214 moved this task from Doing to Closed on the WikiEditor board.

The change will be deployed to Wikimedia wikis next week, 28-30 September, per the usual schedule.

RhinosF1 added a project: MW-1.37-release.

Broken patch hit the cut, needs backport

Change 722888 had a related patch set uploaded (by RhinosF1; author: Ammarpad):

[mediawiki/extensions/WikiEditor@REL1_37] Revert \"Support colon link escapes for categories and files\"

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

Change 722888 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@REL1_37] Revert \"Support colon link escapes for categories and files\"

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

The change will be deployed to Wikimedia wikis next week, 28-30 September, per the usual schedule.

Thanks for the backport