Page MenuHomePhabricator

Disable TextExtracts on file pages
Closed, ResolvedPublic2 Story Points

Description

Trying to obtain a text extract for a foreign file
e.g.
https://en.m.wikipedia.org/wiki/Special:ApiSandbox?useformat=desktop#action=query&prop=extracts&format=json&titles=File%3AMahkama%20du%20Pacha.jpg
doesn't work and requesting an extra for a foreign file is not necessarily useful..
https://commons.m.wikimedia.org/wiki/Special:ApiSandbox?useformat=desktop#action=query&prop=extracts&format=json&titles=File%3AMahkama%20du%20Pacha.jpg

AC

  • When an extract is request for a file (local or foreign):
  • An error is returned.
  • No extract is returned.

Sign off steps

Related Objects

StatusAssignedTask
OpenNone
OpenNone
OpenNone
ResolvedMholloway
ResolvedDereckson
ResolvedJdlrobson
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
DuplicateNone
DuplicateNone
Resolvedovasileva
OpenJdlrobson
ResolvedJdlrobson
Resolvedovasileva
ResolvedFjalapeno
Resolvedphuedx
Resolvedphuedx
ResolvedPchelolo
ResolvedbearND
ResolvedMholloway
ResolvedMSantos
ResolvedMholloway

Event Timeline

Jdlrobson created this task.Oct 1 2015, 8:22 PM
Jdlrobson raised the priority of this task from to Low.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: TextExtracts.
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 1 2015, 8:22 PM
Jdlrobson renamed this task from TextExtracts on file pages do not really make sense to Disable TextExtracts on file pages.Apr 27 2017, 7:55 PM
Jdlrobson added a project: patch-welcome.
Jdlrobson updated the task description. (Show Details)
phuedx added a subscriber: phuedx.Jun 20 2017, 1:13 PM

@Jdlrobson: Should this be generalised to something like "Don't return extracts for pages outside of the content namespace(s)"?

@phuedx I don't think that's wise at this time since file pages have a clear problem but there may be consumers who use TextExtracts for talk pages/portal pages etc... but we could generalise it so we can easily configure this for other namespaces.

phuedx updated the task description. (Show Details)Jun 22 2017, 12:45 PM
Jdlrobson raised the priority of this task from Low to Normal.Jun 28 2017, 6:49 PM

we missed estimating this because we hide low priority tasks. Shame!

phuedx updated the task description. (Show Details)Jun 29 2017, 5:24 PM
Jdlrobson set the point value for this task to 2.

An error is returned.

What kind of error did you have in mind, @phuedx?

Change 363850 had a related patch set uploaded (by Bmansurov; owner: Bmansurov):
[mediawiki/extensions/TextExtracts@master] Return empty extract for articles in File namespace

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

phuedx added a comment.Jul 7 2017, 5:27 PM

Quoting myself from IRC:

i suppose it could be a warning
but generally, if we're going to not generate an extract because the client has requested one for a file page
then we should probably warn 'em
like: "hey. we're not going to do that! :D :D :D lol"
^ actual copy

What I mean is this, if we're not returning an extract for some reason, then we should notify the user as to why. This could be either an error or a warning.

bmansurov removed bmansurov as the assignee of this task.Jul 7 2017, 10:45 PM
bmansurov added a subscriber: bmansurov.

Change 363850 merged by jenkins-bot:
[mediawiki/extensions/TextExtracts@master] Return empty extract for articles in File namespace

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

Jdlrobson updated the task description. (Show Details)Jul 7 2017, 11:17 PM
Jdlrobson updated the task description. (Show Details)
phuedx claimed this task.Jul 10 2017, 5:05 PM

@phuedx I see the following warning when I visit the URL you pasted and make a request:

"warnings": {
        "extracts": {
            "*": "\"exlimit\" was too large for a whole article extracts request, lowered to 1.\nExtract for a title in File namespace was requested, none returned."
        }
    },

Is the warning in the wrong place? Did you want me to output it somewhere else?

phuedx closed this task as Resolved.Jul 11 2017, 1:32 PM
phuedx claimed this task.

Mibad! 👍