Last modified: 2013-11-13 18:28:34 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 T58770, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56770 - mw.util.addPortletLink causes TypeError if the provided jQuery object is empty
mw.util.addPortletLink causes TypeError if the provided jQuery object is empty
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: 1.22.0 release
Assigned To: Umherirrender
: code-update-regression, easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-08 12:01 UTC by Helder
Modified: 2013-11-13 18:28 UTC (History)
4 users (show)

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


Attachments

Description Helder 2013-11-08 12:01:31 UTC
After Change-Id: Ibc86c2dc33a8a3ba378138525c2523ba69bca8f1, I get
"TypeError: Cannot read property 'parentNode' of undefined"
for the command
mw.util.addPortletLink(
'p-lang', '#', 'TEST', 't-test', 'TEST', 'T', $( '.wbc-editpage' ).first()
);
when I use it on
https://en.wikipedia.org/wiki/Main_Page

If the user passes a jQuery object, but it is empty, the function should still default to $ul.append( $item ).
Comment 1 Gerrit Notification Bot 2013-11-10 09:05:13 UTC
Change 94601 had a related patch set uploaded by Umherirrender:
mw.util.addPortletLink: Check length before access array index

https://gerrit.wikimedia.org/r/94601
Comment 2 Bartosz Dziewoński 2013-11-10 09:36:28 UTC
Should we backport this to 1.22, since this is a regression?
Comment 3 Gerrit Notification Bot 2013-11-13 17:50:21 UTC
Change 94601 merged by jenkins-bot:
mw.util.addPortletLink: Check length before access array index

https://gerrit.wikimedia.org/r/94601
Comment 4 Gerrit Notification Bot 2013-11-13 18:19:49 UTC
Change 95190 had a related patch set uploaded by Bartosz Dziewoński:
mw.util.addPortletLink: Check length before access array index

https://gerrit.wikimedia.org/r/95190
Comment 5 Gerrit Notification Bot 2013-11-13 18:25:38 UTC
Change 95190 merged by jenkins-bot:
mw.util.addPortletLink: Check length before access array index

https://gerrit.wikimedia.org/r/95190
Comment 6 Bartosz Dziewoński 2013-11-13 18:28:34 UTC
Fixed, merged, backported to release.

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


Navigation
Links