Last modified: 2014-03-01 17:31:11 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 T64072, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62072 - Kindle 3: JavaScript error message from mobile-frontend-last-modified-months
Kindle 3: JavaScript error message from mobile-frontend-last-modified-months
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-28 20:09 UTC by Axel Boldt
Modified: 2014-03-01 17:31 UTC (History)
7 users (show)

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


Attachments
screen photo of error (1.53 MB, image/jpeg)
2014-02-28 21:00 UTC, Brion Vibber
Details

Description Axel Boldt 2014-02-28 20:09:56 UTC
On a Kindle Keyboard (Kindle 3) running software version Kindle 3.4: use "Search  Wikipedia" and enter "King James". The resulting article is en.m.wikipedia.org/wiki/King_James and displays fine, but at the bottom, just below the "Read in another language" link, the error message

mobile-frontend-last-modified-months: Result of expression 'rule.split('@')[0].trim' [undefined] is not a function

is displayed.
Comment 1 Brion Vibber 2014-02-28 20:28:39 UTC
Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim the String.trim method wasn't added until a relatively recent version of JavaScript, so it may not be available on the Kindle's older browser.

Unless there's a polyfill being used, avoid it in generic-ish code...



Looks like it's being used in core, in resources/mediawiki.libs/CLDRPluralRuleParser.js

Will fire up the test Kindle 3 once it's charged and see if it works with that replaced with a regex.
Comment 2 Brion Vibber 2014-02-28 21:00:42 UTC
Created attachment 14723 [details]
screen photo of error

note JavaScript must be enabled for the error to occur
Comment 3 Bartosz Dziewoński 2014-02-28 21:03:22 UTC
There is $.trim which should be used instead.
Comment 4 Brion Vibber 2014-02-28 21:10:59 UTC
(In reply to Bartosz Dziewoński from comment #3)
> There is $.trim which should be used instead.

The upstream code in https://github.com/santhoshtr/CLDRPluralRuleParser doesn't seem to have any explicit jQuery dependency, so I'd rather not add that here.
Comment 5 Gerrit Notification Bot 2014-02-28 21:13:58 UTC
Change 116159 had a related patch set uploaded by Brion VIBBER:
Fix for CLDR plural rule parser for old browsers without String.trim

https://gerrit.wikimedia.org/r/116159
Comment 6 Gerrit Notification Bot 2014-03-01 04:19:46 UTC
Change 116159 merged by jenkins-bot:
Fix for CLDR plural rule parser for old browsers without String.trim

https://gerrit.wikimedia.org/r/116159
Comment 7 Brion Vibber 2014-03-01 17:31:11 UTC
Ok fix is merged in MediaWiki core and in the lib upstream repo. It should wander into the live site within a couple weeks.

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


Navigation
Links