Bug #17622

Displaying former media appearances is broken on https://tails.boum.org/press/

Added by geb 2020-04-15 12:34:27 . Updated 2020-04-17 15:12:03 .

Status:
Resolved
Priority:
Low
Assignee:
Category:
Target version:
Start date:
Due date:
% Done:

70%

Feature Branch:
geb:bugfix/17622-media-appearances-broken
Type of work:
Website
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

The displaying of former media apparence is broken on https://tails.boum.org/press/

The displaying is broken because, there is a
2019
But no

The script inittoggle on https://tails.boum.org/ikiwiki/toggle.js loops over all #press..media-appearances-20, but find a null for the first one (2019), it is interrupted, and never add the onclick=toggle(this) function for the next ones. Adding back the missing element fix the problem.

I somehow remind sending a similar report previously (last year ?), thus, I would like to suggest adding something to catch the nulls to prevent further issues, this should do the job :

function inittoggle() {
    var as = getElementsByClass('toggle');
    for (var i = 0; i < as.length; i++) {
        var id = as[i].href.match(/#(\w.+)/)[1];
        if (document.getElementById(id) &&
            document.getElementById(id).className == "toggleable")
            document.getElementById(id).style.display="none";
        as[i].onclick = function() {
            toggle(this);
            return false;
        }
    }

@sajolida, guess you may be interested by this report.


Subtasks


Related issues

Related to Tails - Bug #15475: Displaying of old media appearances is broken in press page Resolved 2018-03-29

History

#1 Updated by geb 2020-04-16 17:40:27

  • Status changed from New to In Progress
  • Target version set to Tails_4.6
  • % Done changed from 50 to 70
  • Feature Branch set to geb:bugfix/17622-media-appearances-broken

Hi,

Please merge geb:bugfix/17622-media-appearances-broken.
It also adds 2019 media appareances which was not included anymore in the page.
Tested locally by rebuilding the wiki and browsing the page.

As I figured out toggle.js is an ikiwiki plugin, I did not investigated if and how to fix it.

Also see Bug #15475 & commit:5989eea7b1844fd9a87fbcacb29d697782b8bf96

#2 Updated by geb 2020-04-16 17:41:23

  • related to Bug #15475: Displaying of old media appearances is broken in press page added

#3 Updated by sajolida 2020-04-17 15:12:03

  • Status changed from In Progress to Resolved

Good catch! I merged this!