Page MenuHomePhabricator

CodexHTMLForm: Use a static method in getButtons() instead of an instance of HTMLButtonField
Closed, ResolvedPublic3 Estimated Story Points


Right now CodexHTMLForm::getButtons() creates an instance of HTMLSubmitField for the submit button, and an instance of HTMLButtonField for each of the buttons in $this->mButtons. This causes some issues:

  • These buttons may not have a name or ID, but HTMLButtonField / HTMLSubmitField require the name and ID to be set
  • These buttons may need a tooltip and access key, but HTMLButtonField doesn't handle those attributes

Instead, we should do something similar to what we did in HTMLTextField: create a static method to build the Codex component that we can just pass attributes into, and then use that static method both in HTMLButtonField::getInputCodex() and in CodexHTMLForm::getButtons().

Event Timeline

Catrope set the point value for this task to 3.Apr 1 2024, 5:18 PM

@lwatson @Catrope Should this be child of the EPIC or did we want to separate those follow-ups out?

Change #1017867 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/core@master] CodexHTMLForm: Use a static method in getButtons()

Change #1017867 merged by jenkins-bot:

[mediawiki/core@master] CodexHTMLForm: Use a static method in getButtons()

@Volker_E I'll make this task a child to the EPIC task.