Page MenuHomePhabricator

Add a way to differentiate transcluding a redirect and transcluding a redirect and its target
Open, Needs TriagePublic

Description

It should be possible to differeciente these three cases, assuming you have a Template:A that redirects to a Template:B:

  • A page that only transcludes Template:A using the wikitext {{A}}
  • A page that transcludes both Template:A and Template:B separately using the wikitext {{A}}{{B}}
  • A page that transcludes the content of Template:A (for example using isRedirect in Lua) and transcludes Template:B using the wikitext {{B}}

All three of these cases would add the following entires to the templatelinks table:

tl_fromtl_namespacetl_titletl_from_namespace
?10A0
?10B0

Event Timeline

Marostegui added a subscriber: Marostegui.

Not sure what's expected from the DBA side on this task.
Can you be more specific?

From what I can tell the only way to solve this would be to add more fields to existing tables that track if the transclusion is directly caused by wikitext, create a new table that stores "template links" rather than transclusions, or to only store direct transclusions in the templatelinks table. The first two options would require changes to the database.

As we mentioned on T278236, let's try not to add more stuff to *links tables, they are already under lots of pressure.

Yes. Beside *links not being normalizied (T222224), I think we the best way to do this is store to this secondary data in (on top of *links tables) in a graph database, currently only wdqs uses a graph database but if we want to record and query transitive relationships, graph database is a better choice than MySQL. i.e. let's make sure *links do one thing and do it well instead of adding new functionalities to it that wouldn't work.