Page MenuHomePhabricator

[Refactor] Add helper method to retrieve InternalItems for content and use it in the ContextItem
Closed, ResolvedPublic

Description

Context

We want to T415760: [Epic] Implement a new mechanism that connects MWReferenceNodes with InternalItemNodes. To do that we decided on using the listIndex as a connector between refs and their internal items. We started introducing that for the mainRefKey in T415884: [Refactor] Replace MWReferenceNode.mainRefKey with an index to the main ref InternalItemNode. The mainListIndex could now be used in the code to get the internal items for the main ref's content when working with sub-refs.

Task

We want to use a helper method that can be used to get an InternalItemNode with either listKey and listGroup or listIndex this way we can monitor if the new mechanism works in all cases or if a fallback is needed in some.

Introduce a helper method that retrieves the InternalItemNode either using the listKey and listGroup or an optional listIndex

  • The method should try to use listIndex first but fallback on listKey and listGroup if that fails
  • Add some logging if the fallback is executed although listIndex was defined

Use that method and the mainListIndex to load the content for a main ref in

  • MWReferenceContextItem
Notes

Event Timeline

WMDE-Fisch renamed this task from [Refactor] Rewrite any MWReferenceNode dependencies related to the MWReferenceContextItem to Add helper method to retriev InternalItems and use in MWReferenceContextItem.Jan 30 2026, 1:05 PM
WMDE-Fisch updated the task description. (Show Details)
WMDE-Fisch renamed this task from Add helper method to retriev InternalItems and use in MWReferenceContextItem to Add helper method to retrieve InternalItems and use in MWReferenceContextItem.Jan 30 2026, 1:08 PM
WMDE-Fisch renamed this task from Add helper method to retrieve InternalItems and use in MWReferenceContextItem to Add helper method to retrieve InternalItems for content and use it.Feb 2 2026, 11:01 AM
WMDE-Fisch updated the task description. (Show Details)
WMDE-Fisch updated the task description. (Show Details)
Tobi_WMDE_SW renamed this task from Add helper method to retrieve InternalItems for content and use it to [Refactor] Add helper method to retrieve InternalItems for content and use it.Feb 3 2026, 9:44 AM

Change #1237488 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/extensions/Cite@master] [WIP] Add helper method to retrieve InternalItems for content and use it

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

Change #1238732 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/extensions/Cite@master] New test for getReferenceNode

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

Change #1238752 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/extensions/Cite@master] Use new helper method getInternalModelNode

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

Change #1238694 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] Add helper class for using listIndex to get InternalItemNodes

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

Change #1239754 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] Add helper class for using listIndex to get InternalItemNodes

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

Change #1237488 abandoned by WMDE-Fisch:

[mediawiki/extensions/Cite@master] Add helper method to retrieve InternalItems for content and use it

Reason:

Reworked in I1855444fb24490ef9016288a807913eb24b9c894

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

WMDE-Fisch updated Other Assignee, removed: lilients_WMDE.

Change #1239754 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Add helper class for using listIndex to get InternalItemNodes

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

Change #1238752 abandoned by WMDE-Fisch:

[mediawiki/extensions/Cite@master] Use new helper method getInternalModelNode

Reason:

Something else needs to be solved for this. Abondoning for now.

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

WMDE-Fisch renamed this task from [Refactor] Add helper method to retrieve InternalItems for content and use it to [Refactor] Add helper method to retrieve InternalItems for content and use it in the ContextItem.Mar 16 2026, 12:26 PM

Change #1271882 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Consider completely empty InternalItemNodes missing content

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

Change #1271882 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Consider completely empty InternalItemNodes missing content

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

Change #1238732 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] New test for getReferenceNode

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