Page MenuHomePhabricator

__NONEWSECTIONLINK__ does not properly suppress the "new section" tab on certain "action" pages
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to a page containing the NONEWSECTIONLINK magic word, e.g. Talk:Hillary Clinton/April 2015 move request
  • Note that the "Add Topic" tab is correctly hidden in the top ribbon menu.
  • Click on one of the actions in the top ribbon, e.g. "edit", "history", "related changes", "page information"...
  • Note that the "Add Topic" button is incorrectly displayed in the top ribbon menu.
    • Clicking on the button starts the discussion tools new section dialogue

Other information (browser name/version, screenshots, etc.):

Filing per https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Could_someone_report_a_bug_for_me?

Event Timeline

Tacsipacsi subscribed.

As far as I remember, this has always been so, long before DiscussionTools became a thing.

Yeah, unrelated to DiscussionTools, which just piggybacks off of mediawiki's existing behavior around the "new topic" link.

I think this is because __NONEWSECTIONLINK__ is extracted by the parser, so it's only available when you've actually parsed the wikitext for the page... and so we only know about it when we're on the read-view for the page. To fix this we'd need to either:

  1. Reparse the page wikitext whenever non-read actions are visited, even though we're not going to display the output
  2. Cache the magic-word directives like this somewhere that can be independently checked

The former has potential performance implications (lots more mostly-unnecessary wikitext parsing would be happening), but would avoid us needing to keep a cache in sync as revisions change. I'd be inclined to say that doing either is pretty low-priority, given the trade-offs involved.

Cache the magic-word directives like this somewhere that can be independently checked

They are sort of cached in the page_props database table. One more read query in these views shouldn't, in my opinion, make things worse.

@matej_suchanek huh, you're right, it's in there as newsectionlink -- I could have sworn it wasn't available. 😂

Aklapper renamed this task from __NONEWSECTIONLINK__ does not properly supress the "new section" tab on certain "action" pages to __NONEWSECTIONLINK__ does not properly suppress the "new section" tab on certain "action" pages.Aug 17 2023, 3:52 PM