Jump to content

Topic on Extension talk:JSBreadCrumbs

Filburt (talkcontribs)

Hi,

thanks for the extension. Sometimes, on some pages I get duplicate entries in the breadcrumb list:


Do you have any idea, how to solve this problem? Thank you and greetings

Ryan lane (talkcontribs)

Hmm. That's odd. Duplicates are definitely supposed to be getting stripped. I'll see if I can replicate the issue.

Badon (talkcontribs)

I don't know if you've duplicated this or not yet, but I see that it isn't fixed. I duplicated it. It is a bug triggered by visiting edit, history, and maybe a few other pages, which then show up in the list. Once you visit one of those pages, JSBreadCrumbs will continually add more of them, including the main page, unlimited numbers of times, with no removal of duplicates. It's as if it forgets about removing duplicates for that page.

Those pages should be counted as duplicates and removed. There might be other pages that should be removed too, but I can't think of them off the top of my head.

Ryan lane (talkcontribs)

Thanks for duplicating it. I'll see if I can get time to work on this. I'm pretty swamped right now due to Wikimedia projects... I'd of course take patches, if you happen to fix it before I get to it.

Badon (talkcontribs)

Unfortunately, I'm not a coder, but with some more practice I might be able to play one on TV :) It looks like any of the "&action=" parameter-url pages will trigger this bug. If I start feeling confident, I might try to fix it. Then I'll have to figure out how to produce a patch.

Badon (talkcontribs)

Also, ?title= will trigger the bug too. It looks like any URL variation on the page will trigger the bug.

Sethlivingston (talkcontribs)

I fixed this with code that skips adding the current page to the breadcrumbs if it's an action page (edit, view history, ...). The relevant code modifications to /js/BreadCrumbs.js are shown below. Note that you might be reading this post after Ryan has already had a chance to incorporate this or a different fix; get the latest version first.

    // Don't add this page if it's an action page (edit, view history, ...)
    if (!location.search || location.search.indexOf('action=') == -1)
    {
        // Remove duplicates
        ...

        // Add the current page
        ...

        // Ensure we only display the maximum breadcrumbs set
        ...
    }
Reply to "Duplicate entries"