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.

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseSchema : masterTell the user that more info about errors is available
mediawiki/extensions/WikibaseSchema : masterImplement length limit for schema text
mediawiki/extensions/WikibaseSchema : masterRefactor so method does one thing only

Event Timeline

Michael claimed this task.Mar 13 2019, 10:24 AM
Michael moved this task from Backlog to Doing on the Shape Expressions Sprint 4 board.
Restricted Application added a project: User-Michael. · View Herald TranscriptMar 13 2019, 10:24 AM

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 added a subscriber: Lea_Lacroix_WMDE.

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

Michael removed Michael as the assignee of this task.Mar 18 2019, 10:49 AM
Michael added a subscriber: Michael.

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 claimed this task.Mar 18 2019, 4:07 PM
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

Lydia_Pintscher closed this task as Resolved.Mar 20 2019, 11:31 AM
Lydia_Pintscher moved this task from Verification to Done on the Shape Expressions Sprint 4 board.

\o/