Page MenuHomePhabricator

Validate that favorite templates are valid page IDs in the correct namespace when loading from user preferences
Closed, ResolvedPublic8 Estimated Story Points

Description

When loading the templatedata-favorite-templates array from the user's preferences, ensure that they are:

  • A valid page ID (i.e. the page exists)
  • That the page is in a TemplateDataEditorNamespaces namespace

Any pages which fail validation should be removed from the favorites array.

Event Timeline

TheresNoTime renamed this task from Use LoadUserOptions hook to validate favourite templates to Use LoadUserOptions hook to check that favourite templates are valid page IDs in the correct namespace.Mar 6 2025, 12:16 PM

Change #1125470 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/TemplateData@master] [WIP] ext.templateData.templateDiscovery: Validate on save, add caching

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

Change #1128419 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/TemplateData@master] ext.templateData.templateDiscovery: Validate favorites on load

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

TheresNoTime renamed this task from Use LoadUserOptions hook to check that favourite templates are valid page IDs in the correct namespace to Validate that favorite templates are valid page IDs in the correct namespace when loading from user preferences.Mar 17 2025, 2:11 PM
TheresNoTime updated the task description. (Show Details)

Change #1128419 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] ext.templateData.templateDiscovery: Validate favorites on load

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

KSiebert set the point value for this task to 8.Mar 20 2025, 10:21 AM

Is there more to do here? The caching is going to happen in a separate task now isn't it?

KSiebert changed the task status from Open to Stalled.Mar 27 2025, 10:38 AM

Change #1125470 abandoned by Samtar:

[mediawiki/extensions/TemplateData@master] ext.templateData.templateDiscovery: Validate on save, add caching

Reason:

Patch split out

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