Page MenuHomePhabricator

Implement length limit for schema text
Closed, ResolvedPublic

Description

Configurable, defaults to 50 000 bytes for now. Consider how to inform the user if the limit is exceeded.

Event Timeline

Change 496153 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Refactor so method does one thing only

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

Change 496154 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Implement length limit for schema text

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

Change 496153 merged by Michael Große:
[mediawiki/extensions/WikibaseSchema@master] Refactor so method does one thing only

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

Change 496154 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Implement length limit for schema text

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

Lea_Lacroix_WMDE subscribed.

I tested it by copying a long Wikipedia article in the field :D
I got two different warnings: "There are problems with some of your input." before the input field and the length error message below the field.
It would be great to have the first message to say "There are problems with some of your input. Please check the error message below."

Also we should follow the OOUI guidelines for errors https://phabricator.wikimedia.org/M241

I tested it by copying a long Wikipedia article in the field :D
I got two different warnings: "There are problems with some of your input." before the input field and the length error message below the field.
It would be great to have the first message to say "There are problems with some of your input. Please check the error message below."

That message is currently hard-coded in mediawiki core: https://github.com/wikimedia/mediawiki/blob/5612194879bd4f5c7d3e7c75d42b08bf91b84428/includes/htmlform/HTMLForm.php#L612

Also we should follow the OOUI guidelines for errors https://phabricator.wikimedia.org/M241

We are currently using the form error message from mediawiki core. But we could add our own styles on this page to adjust their styles. 🤔

@Lea_Lacroix_WMDE @Lydia_Pintscher would you be ok with opening a new ticket for these style adjustments? That would allow us to discuss and estimate them separately from the functionality itself.

PS: also compare the current design in Wikibase https://test.wikidata.org/wiki/Special:SetLabelDescriptionAliases/Q123/

Michael moved this task from Backlog to Doing on the Shape Expressions Sprint 4 board.

I tested it by copying a long Wikipedia article in the field :D
I got two different warnings: "There are problems with some of your input." before the input field and the length error message below the field.
It would be great to have the first message to say "There are problems with some of your input. Please check the error message below."

That message is currently hard-coded in mediawiki core: https://github.com/wikimedia/mediawiki/blob/5612194879bd4f5c7d3e7c75d42b08bf91b84428/includes/htmlform/HTMLForm.php#L612

After looking into this some more, this turned out to be easier than expected!

Change 497332 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Tell the user that more info about errors is available

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

Change 497332 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Tell the user that more info about errors is available

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

Change 497332 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Tell the user that more info about errors is available

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