Last modified: 2014-08-17 11:01:45 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 T70064, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68064 - Can't dismiss banners on mobile due to $.toJSON not being defined
Can't dismiss banners on mobile due to $.toJSON not being defined
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-15 20:15 UTC by Ryan Kaldari
Modified: 2014-08-17 11:01 UTC (History)
5 users (show)

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


Attachments

Description Ryan Kaldari 2014-07-15 20:15:35 UTC
On my local machine, the hideBanner() function doesn't work in mobile because it throws the following JS error:

$.toJSON is not a function

in BannerController:
$.cookie(
    'centralnotice_hide_' + mw.centralNotice.data.category,
    $.toJSON( cookieVal ),
    { expires: d, path: '/' }
);

I'm not sure why $.toJSON isn't working on mobile, but it's deprecated anyway and is going to be removed from core in MW 1.25. You should use JSON.stringify instead.
Comment 1 Matt Walker 2014-07-15 20:20:56 UTC
According to Krinkle we do polyfill the JSON object on IE6/7 -- which was the reason we used the jQuery version.
Comment 2 Krinkle 2014-07-15 20:22:29 UTC
If $.toJSON is undefined you forgot to declare a dependency on jquery.json.

In other news, jquery.json and its $.toJSON are deprecated. Use module 'json' and JSON.stringify instead.
Comment 3 Ryan Kaldari 2014-07-15 20:23:28 UTC
There's a 'json' module that should be able to handle that. See resources/lib/json2/json2.js in core.
Comment 4 Gerrit Notification Bot 2014-07-15 20:30:36 UTC
Change 146591 had a related patch set uploaded by Kaldari:
Adding missing jquery.json depenency needed for dismissing banners

https://gerrit.wikimedia.org/r/146591
Comment 5 Gerrit Notification Bot 2014-07-15 20:35:42 UTC
Change 146591 merged by jenkins-bot:
Adding missing jquery.json depenency needed for dismissing banners

https://gerrit.wikimedia.org/r/146591
Comment 6 Gerrit Notification Bot 2014-07-15 20:58:49 UTC
Change 146599 had a related patch set uploaded by Ejegg:
Adding missing jquery.json depenency needed for dismissing banners

https://gerrit.wikimedia.org/r/146599
Comment 7 Gerrit Notification Bot 2014-07-15 21:04:33 UTC
Change 146599 merged by Ejegg:
Adding missing jquery.json depenency needed for dismissing banners

https://gerrit.wikimedia.org/r/146599
Comment 8 Andre Klapper 2014-08-17 11:01:45 UTC
All patches merged - assuming this bug is FIXED.
If that is not the case: Please reopen and elaborate what is left to do here to get this report fixed.

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


Navigation
Links