Page MenuHomePhabricator

Special:LonelyPages shows transcluded pages
Closed, ResolvedPublic


Author: alternative_to_what

The orphaned articles page shows pages that have been trasncluded into other pages exclusively.

  1. Create a page that has no incoming links
  2. Transclude that page into another page

Actual Results:
Page shows up as Orphaned. You have to go to the page, then click the "what links here" link to see that it's been transcluded (i.e., not really orphaned)

Expected Results:
Page does not show up as orphaned.

Version: 1.11.x
Severity: minor



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:03 PM
bzimport set Reference to bz12764.
bzimport added a subscriber: Unknown Object (MLST).

This is because lonely pages are found by querying pagelinks table, and this table is supposed to store the links; here is the list of its fields:

pl_from int(10) unsigned NO PRI 0
pl_namespace int(11) NO PRI 0
pl_title varchar(255) NO PRI

I suppose, in order to support for translusions gettings listed on this table, at least one new column should be added (to distinguish links from transclusions). Another idea is not to store the transclusions in the pagelinks table, but to use the same method used by SpecialWhatlinkshere to exclude orphan pages which are transcluded somewhere. The latter method may not be cost-effective though.

alternative_to_what wrote:

It appears that transcluded pages are stored in the templatelinks table. I'm not sure what the performance ramifications would be, but perhaps the LonelyPages query could be modified to also check the templatelinks table to determine if these pages pages are exclusively transcluded.

Query might look like this:
SELECT <what you need>

FROM <pagetable>
LEFT JOIN <pagelinktable>
    ON page_namespace=pl_namespace AND page_title=pl_title
LEFT JOIN <templatelinktable>
    ON page_namespace=tl_namespace AND page_title=tl_title
WHERE pl_namespace IS NULL
    AND page_namespace=<correct namespace>
    AND page_is_redirect=0
    AND tl_namespace IS NULL

alternative_to_what wrote:

Possible patch

This is my proposed patch, based on the 1.11.0 code, simply added a join to another table to hopefully, correctly identify articles that are not linked to, but are part of (transcluded into) other articles.

attachment SpecialLonelypages.php ignored as obsolete

Comment on attachment 4575
Possible patch

What you uploaded was not a patch, but a section of code. I'll upload the patch as soon a I can.

Created attachment 4576
Introduces the desired effect, and also updates the description of Special:Lonelypages

This patch adds the requested feature.


alternative_to_what wrote:

(In reply to comment #4)

(From update of attachment 4575 [details])
What you uploaded was not a patch, but a section of code. I'll upload the patch
as soon a I can.

Thanks, kinda new to this whole thing.