Last modified: 2014-11-13 03:58:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73584, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71584 - Flow: Topic Titles trimmed to 200 characters when editing
Flow: Topic Titles trimmed to 200 characters when editing
Status: PATCH_TO_REVIEW
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-03 01:22 UTC by Quiddity
Modified: 2014-11-13 03:58 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Quiddity 2014-10-03 01:22:58 UTC
If I make a new topic, with 256 characters in the title, e.g. http://ee-flow.wmflabs.org/wiki/Topic:S3goq6o2pw8xejcw 
as soon as I click "Edit title", only 200 characters are in the text-field.

Expected: All 256 characters are in the text-field.


(Sidenotes, possibly worth splitting into a new bug: 
* The titles should be limited to 255 bytes (Not the current 260 bytes). Possibly there's a global variable we can share?)
* The text-fields should not accept more content than the character/byte limit - currently it extends infinitely, but gives warnings if we try to save with more than 260 bytes. - Compare this with a wikitext page: https://www.mediawiki.org/w/index.php?title=User_talk:Quiddity_%28WMF%29/sandbox&action=edit&section=new
Comment 1 Quiddity 2014-10-03 01:42:09 UTC
https://trello.com/c/3jmb9Ucx/
Comment 2 Matthew Flaschen 2014-10-03 01:44:54 UTC
There is a library for this, jquery.byteLimit.

Unlike maxlength, it is a byte limit, not a character limit, which probably fits the situation here.
Comment 3 Matthew Flaschen 2014-10-03 01:45:14 UTC
(In reply to Matthew Flaschen from comment #2)
> There is a library for this, jquery.byteLimit.

This is in core.
Comment 4 spage 2014-10-03 02:43:15 UTC
In Firebug, a long title has a data-title attribute on the h2 class that is max 200 characters or 199 characters ending with "...".

flow-board.js' editTopicTitle() function passes 'content': $title.data( 'title' ) to the flow_edit_topic_title form template, so this truncated title is what is shown in the form, hence this bug. I think Flow uses this data-title rather than directly using the h2 contents to avoid bugs with improper escaping.

The data-title attribute is only 199-200 characters because handlebars/flow_topic_titlebar_content.handlebars template has
   <h2 class="flow-topic-title" data-title="{{plaintextSnippet content.format content.content}}

and the plainTextSnippet() helper function truncates.

We should be using constants for this, even sending them to JS using ResourceLoaderConfigVars. BTW there are two places where substr( 0, 200 ) appears in flow-board.js.  The server-imposed length limit comes from PostRevision::MAX_TOPIC_LENGTH = 260.  MediaWiki's 255-character title length is discussed in https://www.mediawiki.org/wiki/Page_title_size_limitations and it might be worth matching it for consistency, but a topic title is not the same as a page title. If we do want Flow titles to play by the same rules then we could feed them into a MediaWikiTitleCodec for validation.
Comment 5 Gerrit Notification Bot 2014-10-14 12:32:49 UTC
Change 166559 had a related patch set uploaded by Matthias Mullie:
(bug 71584) Fetch title content from API

https://gerrit.wikimedia.org/r/166559
Comment 6 Gerrit Notification Bot 2014-10-30 03:08:52 UTC
Change 166559 merged by jenkins-bot:
(bug 71584) Fetch title content from API

https://gerrit.wikimedia.org/r/166559
Comment 7 Matthew Flaschen 2014-11-13 03:58:25 UTC
Is this fixed?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links