Page MenuHomePhabricator

redlink=1 not respected in zhwiki
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
It shows a page with noarticletext/noarticletextanon even if the page is creatable.

(Also reproducible at https://zh.wikipedia.org/w/index.php?title=Wikipedia:123123&action=edit&redlink=1, though you need an autoconfirmed account there as such page can only be created by autoconfirmed users in zhwiki)

What should have happened instead?:
It should open a page creating that title. Compare https://zh.wikipedia.org/w/index.php?title=123123&action=edit&redlink=1 and https://zh.wikipedia.org/w/index.php?title=123123&action=edit&redlink=1, both are titles you can create.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
Resolvedmpopov
ResolvedBUG REPORTmatmarex

Event Timeline

matmarex subscribed.

This is caused by DiscussionTools. The "new topic tool" feature is supposed to take over talk pages that do not exist, to display a short introduction, as you can see here: https://zh.wikipedia.beta.wmflabs.org/w/index.php?title=Wikipedia_talk:123123&action=edit&redlink=1 (note the "Wikipedia talk" namespace).

However, it looks like it also takes over some non-talk namespaces, as you noticed. This should not happen.

However, it looks like it also takes over some non-talk namespaces, as you noticed. This should not happen.

@matmarex are you able to share what is taking "...over some non-talk namespaces..."?

On first read, I thought you were referring to the new empty state we introduced appearing where it shouldn't be. Although, on the page @Bugreporter linked to [i], I'm not seeing the empty state we recently introduced.[ii]


@matmarex are you able to share what is taking "...over some non-talk namespaces..."?

Those where the reply tool is available, that is, "Wikipedia:" and "Help:" namespaces on most projects. (See T249036 for details.)

On first read, I thought you were referring to the new empty state we introduced appearing where it shouldn't be. Although, on the page @Bugreporter linked to [i], I'm not seeing the empty state we recently introduced.[ii]

One part of our code assumes that our "empty state" should be shown, and causes the view mode to display instead of the edit mode; but another part decides that it should not, so the normal view mode appears instead.

Compare:

Both links should display the edit mode, but the first link instead shows the view mode.

Yeah, looks like the onGetActionName hook should be a little smarter about this?

Change 722428 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Put all checks for enabling the empty state for talk pages in one place

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

Change 722428 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Put all checks for enabling the empty state for talk pages in one place

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

DLynch added a project: Editing QA.

You should be able to test this on beta using the links in matmarex's earlier post. Given the patch that was written, it'd be good if we could test anything you can think of around the empty-state display, with and without discussiontools enabled -- if we got the logic wrong, it could manifest as either the "edit" page appearing like the regular article view, or as the empty-state version not being shown.

You should be able to test this on beta using the links in matmarex's earlier post. Given the patch that was written, it'd be good if we could test anything you can think of around the empty-state display, with and without discussiontools enabled -- if we got the logic wrong, it could manifest as either the "edit" page appearing like the regular article view, or as the empty-state version not being shown.

Okay, so I checked with different non-existent user talk pages on beta cluster's zh wiki, with and without Discussion Tools being enabled, then with and without New Discussion Tool (Quick Topic Adding) being enabled. It is showing the empty state correctly for each cases. And, I have not noticed any occurrences where the regular article view is appearing instead of the edit mode.

However, if I switch to the talk page of the project page that was originally mentioned on this task with NDT enabled, it shows the empty state design for a split second, and then loads the new topic adding tool and closing the NDT tool shows the empty state design as well. Is that expected?

However, if I switch to the talk page of the project page that was originally mentioned on this task with NDT enabled, it shows the empty state design for a split second, and then loads the new topic adding tool and closing the NDT tool shows the empty state design as well. Is that expected?

It's caused by the site JS, specifically this part in https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Common.js:

/* 智能讨论页编辑(新建) */
$(function () {
  var catalk = $('#ca-talk');
  if (catalk.hasClass('new') && mw.config.get('wgNamespaceNumber') != 2) {
    var a = $('a:first', catalk);
    a.attr('href', a.attr('href') + '&section=new');
  }
});

(The comment at the top means "Smart discussion page editing (new)", according to Google. The same code also appears on the production wiki: https://zh.wikipedia.org/wiki/MediaWiki:Common.js.)

It's intended to change the "Talk" tab, so that when the talk page doesn't exist, the tab opens the new section editor interface, instead of the normal editor interface. But when our new topic tool is enabled, it replaces our empty state.

I think it's fine to leave it that way… But if we wanted to change it, the JS could also check that the new topic tool isn't enabled (mw.user.options.get('discussiontools-newtopictool') == 0).

However, if I switch to the talk page of the project page that was originally mentioned on this task with NDT enabled, it shows the empty state design for a split second, and then loads the new topic adding tool and closing the NDT tool shows the empty state design as well. Is that expected?

It's caused by the site JS, specifically this part in https://zh.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Common.js:

/* 智能讨论页编辑(新建) */
$(function () {
  var catalk = $('#ca-talk');
  if (catalk.hasClass('new') && mw.config.get('wgNamespaceNumber') != 2) {
    var a = $('a:first', catalk);
    a.attr('href', a.attr('href') + '&section=new');
  }
});

(The comment at the top means "Smart discussion page editing (new)", according to Google. The same code also appears on the production wiki: https://zh.wikipedia.org/wiki/MediaWiki:Common.js.)

It's intended to change the "Talk" tab, so that when the talk page doesn't exist, the tab opens the new section editor interface, instead of the normal editor interface. But when our new topic tool is enabled, it replaces our empty state.

I think it's fine to leave it that way… But if we wanted to change it, the JS could also check that the new topic tool isn't enabled (mw.user.options.get('discussiontools-newtopictool') == 0).

Got it. Thanks for explaining it @matmarex. I will move it to Sign Off then and let @ppelberg decide : )

However, if I switch to the talk page of the project page that was originally mentioned on this task with NDT enabled, it shows the empty state design for a split second, and then loads the new topic adding tool and closing the NDT tool shows the empty state design as well. Is that expected?

To clarify, the expected behavior is that the empty state design should be shown. The actual behavior (caused by the zh.wp site JS) is that the new topic adding tool opens instead.

I proposed changing this at zh.wp: https://zh.wikipedia.org/wiki/MediaWiki_talk:Common.js#Request_to_change_links_to_talk_pages_("智能讨论页编辑(新建)")