Last modified: 2014-02-28 20:44: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 T42152, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40152 - Exception thrown on donate.wikimedia.org due to non-existing "monthly-link" element ID
Exception thrown on donate.wikimedia.org due to non-existing "monthly-link" e...
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Fundraising (Other open bugs)
unspecified
All All
: Low critical (vote)
: ---
Assigned To: Nobody - You can work on this!
aklapper-moreinfo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-10 23:26 UTC by Krinkle
Modified: 2014-02-28 20:44 UTC (History)
3 users (show)

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


Attachments
Screenshot of exception (259.87 KB, image/png)
2012-09-10 23:26 UTC, Krinkle
Details

Description Krinkle 2012-09-10 23:26:34 UTC
Created attachment 11103 [details]
Screenshot of exception

Following code throws an exception on all pages currently:


  <ul class="form-info-links">
    <!--  <li><a id="monthly-link" href="..">..</a></li>-->
    <li><a id="onetime-link" href="..">..</a></li>
  </ul>
  <script>
    ..
    document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);
    $('#monthly-link').show();
   ..


Because "monthly-link" doesn't exist.

* If you comment out a link, think further and also disable related code
* Use jQuery for both statements so this doesn't happen
* Test (!)

-- Krinkle


... because document.getElementById('monthly-link') returns null if there is no such ID in the document (comments don't run)
Comment 1 Krinkle 2012-09-10 23:27:11 UTC
I would've fixed it myself, but the output is a bit messy, no idea where this inline stuff is coming from.
Comment 2 Andre Klapper 2012-12-21 17:06:16 UTC
The offending line now says:
$('#monthly-link').attr('href', baseURL + $.param(paramsOut));
Comment 3 Andre Klapper 2013-01-04 16:29:34 UTC
Could somebody from the Fundraising time confirm this is fixed?
(Or could Krinkle reassure that this is obsolete now, see comment 2?)
Comment 4 Krinkle 2013-01-13 20:47:42 UTC
(In reply to comment #2)
> The offending line now says:
> $('#monthly-link').attr('href', baseURL + $.param(paramsOut));

Indeed, it no longer throws an exception this way. Marking WORKSFORME.

I wouldn't say fixed because it still doesn't make sense to have dozens of inline script tags, global variables and commented out HTML without also commenting out the related logic and what not. It is a big mess.
Comment 5 Peter Gehres 2013-01-13 20:51:34 UTC
(In reply to comment #4)
> 
> I wouldn't say fixed because it still doesn't make sense to have dozens of
> inline script tags, global variables and commented out HTML without also
> commenting out the related logic and what not. It is a big mess.

Welcome to donatewiki, It's a Big Mess (TM). It on Fundraising's radar to overhaul since it was written in haste before the 2011 Fundraiser and hasn't gotten any attention since then.  

Thanks for letting us know about things like this.

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


Navigation
Links