Last modified: 2013-02-06 19:00:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42283, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40283 - API retrieval of links from a page does not work with DPL
API retrieval of links from a page does not work with DPL
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
DynamicPageList (Other open bugs)
unspecified
All All
: Low major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-16 15:50 UTC by Brian McNeil
Modified: 2013-02-06 19:00 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brian McNeil 2012-09-16 15:50:09 UTC
When using the API to retrieve links within a page, it does not parse the contents of any DPL included within the page and return links listed within the DPL.

Examples:

1. https://en.wikinews.org/w/api.php?action=query&prop=links&titles=Main%20Page&plnamespace=0&pllimit=500

This retrieves all main namespace pages linked-to from the Wikinews main page, but not those which are listed by using a DPL.

Note that [[n:Samoa looking ahead to Rio Paralympics with eye on powerlifting]] is not returned by the API, but listed in the main headlines DPL and the original reporting DPL.

2. https://en.wikinews.org/w/api.php?action=query&prop=links&titles=User%3ANewsieBot%2FArticleWatch&plnamespace=0&pllimit=500

Nothing is returned in the list of links. The page (see view source) is simply a DPL.
Comment 1 db [inactive,noenotif] 2012-09-16 17:53:32 UTC
That sounds like a problem with the extensions, because the extension is not register the links at the parser output and than the links not added to the database. API prop modules does not reparse the content, that is to expensive. the API parse module cannot list this links for the same reason.

The linked pages also not shown, when using Special:RecentChangesLinked.
Comment 2 Brian McNeil 2012-09-17 05:27:24 UTC
I'm not particularly fussed with *where* the bug originates.

My issue is that the API is supposed to provide a list of all links from a specific page. And, this is a case where it does not.

That is a bug in the API, because the API is not doing what it says on the tin.
Comment 3 Bawolff (Brian Wolff) 2012-09-17 15:19:55 UTC
Yeah I suppose DPL should add the links to the link table.

On the other hand. DPL updates even in times that linkupdates do not occur, which means that the list of links would get out of date on some pages (for pages like the Main Page, probably very quickly).

For now you can work around by screen scraping ?action=render or the api parse action.
Comment 4 db [inactive,noenotif] 2012-09-20 19:51:50 UTC
(In reply to comment #2)
> I'm not particularly fussed with *where* the bug originates.
> My issue is that the API is supposed to provide a list of all links from a
> specific page. And, this is a case where it does not.
> That is a bug in the API, because the API is not doing what it says on the tin.

It is a problem of DPL and the api is only one part, where this bug is visible.

You will also not seeing the links on Special:WhatLinksHere of the target or with list=backlinks of the target, because there are not in the database and cannot be selected.
Comment 5 Sam Reed (reedy) 2012-09-21 01:54:16 UTC
(In reply to comment #3)
> Yeah I suppose DPL should add the links to the link table.
> 
> On the other hand. DPL updates even in times that linkupdates do not occur,
> which means that the list of links would get out of date on some pages (for
> pages like the Main Page, probably very quickly).
> 
> For now you can work around by screen scraping ?action=render or the api parse
> action.

(In reply to comment #4)
> (In reply to comment #2)
> > I'm not particularly fussed with *where* the bug originates.
> > My issue is that the API is supposed to provide a list of all links from a
> > specific page. And, this is a case where it does not.
> > That is a bug in the API, because the API is not doing what it says on the tin.
> 
> It is a problem of DPL and the api is only one part, where this bug is visible.
> 
> You will also not seeing the links on Special:WhatLinksHere of the target or
> with list=backlinks of the target, because there are not in the database and
> cannot be selected.



Seems very WONTFIXy
Comment 6 Bawolff (Brian Wolff) 2012-09-21 16:52:13 UTC
>Seems very WONTFIXy

That was my initial thoughts. But then I thought its really no different then people who do things like {{#ifeq:{{CURRENTHOUR}}||[[foo]]|[[bar]]}}. So now I'm kind of leaning towards fixing it.

As far as the actual fix goes, its not very difficult, the link table just may not be up to date. I somewhat withdraw my specific example of the Main Page, since that has templates that are updated multiple times a day, which means link updates happen often. But Brianmc's example of a DPL page to feed a bot would have the pagelinks table not stay in sync all that well unless null edits were manually applied (or one could just look at the links from the ParserOutput in action=parse which wouldn't have that issue and be much better than screen scraping)
Comment 7 db [inactive,noenotif] 2012-09-22 08:54:58 UTC
(In reply to comment #6)
> >Seems very WONTFIXy
> That was my initial thoughts. But then I thought its really no different then
> people who do things like {{#ifeq:{{CURRENTHOUR}}||[[foo]]|[[bar]]}}. 

That is bug 18478

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links