Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
BBC RussianHomePhabricator
Log In
Maniphest T116145

Atom feed should not be advertised if $wgFeed is false
Closed, ResolvedPublic

Description

If $wgFeed is false we generate links to feeds that cause feed-unavailable error.

Event Timeline

saper raised the priority of this task from to Needs Triage.
saper updated the task description. (Show Details)
saper subscribed.
saper set Security to None.

Change 247821 had a related patch set uploaded (by saper):
Advertise feeds only if $wgFeed is enabled

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

Patches were submitted to fix this bug a year and a half ago, but never merged. The bug still exists. What needs to happen now? Can I help?

Until the bug is fixed, a workaround for hiding the Atom link in the sidebar of the RecentChanges page is to make these arrays empty in LocalSettings.php:

$wgFeedClasses = [];
$wgAdvertisedFeedTypes = [];

Change 247821 was written before the addition of the hook AfterBuildFeedLinks. In order to make the equivalent change now, it's necessary to decide whether AfterBuildFeedLinks should be called unconditionally, or only when $wgFeed is true.

Change 247821 says, "Additionally do not require $wgFeed=true in order to use $wgOverrideSiteFeed. Wikis that use an external feed (from some blog, news site, etc.) may want to completely disable MediaWiki built-in feed feature."

Similar reasoning suggests the possibility that wikis that use external feeds may want to hook AfterBuildFeedLinks even when $wgFeed is false.

I'm somewhat uncomfortable with the fact that Change 247821 not only fixes the bug which is the main point of T116145, but also makes the change in getHeadLinksArray related to the "Additionally..." comment. Maybe it would have been better to treat that as a separate issue. Nevertheless, I'm imitating Change 247821 as closely as possible while taking into account other changes that have been applied to master, including AfterBuildFeedLinks.

I submitted this change with git review:

https://gerrit.wikimedia.org/r/#/c/363126/

(I should have included "Bug: T116145" in the commit message.)

ThomasEugeneBishop raised the priority of this task from Low to Medium.Jul 4 2017, 7:30 AM

I raised the priority of this task from Low to Normal. A documented feature ($wgFeed) clearly fails to work. This is a bug fix, not a feature enhancement. The bug has been encountered in actual usage by different people. Someone made the effort, long ago, to create this task and provide a solution. Someone else studied the solution and expressed approval. I've brought it up to date with changes that occurred in the meantime. Following through and merging the solution, before it gets out of sync with the master branch again, can't reasonably be considered a low priority.

Change 363126 had a related patch set uploaded (by saper; owner: ThomasEugeneBishop):
[mediawiki/core@master] Advertise feeds only if $wgFeed is enabled

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

Saper has updated here, with added testing:

https://gerrit.wikimedia.org/r/#/c/247821/

If and when somebody authorized to merge is willing to review, I'm available to help further as needed.

Krenair assigned this task to saper.
Krenair subscribed.

the diffs looked okay, but on merge realised it needed a rebase which I did (first of all wrong, now it should be fine) but there are now failing tests

actually it doesn't look like the bug actually reproduces on latest master

It does reproduce for me on 1.32.0 using the Vector skin. Did you try going to "Recent Changes"? That's where I see the "Atom" link in the left sidebar with an orange RSS icon. I don't see it on other pages.

right, I see, was looking for <link> elements in the <head>

Change 247821 merged by jenkins-bot:
[mediawiki/core@master] Advertise feeds only if $wgFeed is enabled

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

Change 363126 abandoned by Alex Monk:
Advertise feeds only if $wgFeed is enabled

Reason:
Replaced with Ic64f7f51

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