Back to top link is repeated

Created on 6 August 2024, 4 months ago
Updated 31 August 2024, 4 months ago

Problem/Motivation

Back to top links are repeated 6 times (screenshot) on a fresh Drupal 10.3.1 install with composer.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇮🇹Italy kopeboy Milan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kopeboy
  • 🇫🇷France mably

    You could give a try to the actively maintained toc_ng module which is a fork of Toc.js and see if your problem has been fixed.

  • 🇫🇷France flocondetoile Lyon

    @mably, it would be nice to stop spamming this issue queue with advertising for your fork. And also I don't understand why you fork this module instead of working (together) on the original, in a more collaborative way.

  • 🇫🇷France mably

    Hello @flocondetoile, I'm just trying to help here, as this module development seems stalled.

    As I said already, we are willing to merge everything black to toc.js if you are interested.

    But we have to move fast to get what we need for our web sites released on time.

    We could work behind closed doors but we prefer to share our work with the community.

  • 🇫🇷France flocondetoile Lyon

    > As I said already, we are willing to merge everything black to toc.js if you are interested.

    To be interested, we need to know why you fork this project (excluded the need "to move fast"), and what you have added as new feature. Looks like you fork too the toc.js library itself and embed it directly in your code. Anyway the best way to discuss this is in a dedicated issue and not by hacking any issue/report done on this project.

  • 🇫🇷France mably

    @flocondetoile specific issued 📌 Backporting code from the forked module toc_ng Needs review created.

  • 🇬🇧United Kingdom SirClickALot Somerset

    Aside from the conversation above RE the fork, I should also like to say that I too am seeing multiple Back to top links.

    In my case, with my theme, it's three so there might be a clue there as to what causes this.

  • First commit to issue fork.
  • 🇫🇷France flocondetoile Lyon

    On a fresh install on 10.3.2 I didn't succeed to reproduce this issue.

  • 🇫🇷France flocondetoile Lyon

    Could you try this patch ? If this don't resolve the bug (it's a blind patch), so I need context to be able to reproduce this issue.

  • Status changed to Needs review 4 months ago
  • 🇬🇧United Kingdom SirClickALot Somerset

    I have applied the patch to the toc.js file but it does not seem to have solved the problem.

    What I do note is that the Back to top link does appears on a fresh page refresh but then (in my case) two more get added slightly later as illustrated below...

    What else can I do to help provide more context?

    Drupal 10.3.2
    Apache/2.4.33 (Win64) OpenSSL/1.0.2u mod_fcgid/2.3.9 PHP/8.3.1
    PHP 8.3.7, memory limit: 256M
    MySQL 5.7.24
    PHP Caching module: OpCache

    Web browser: Version 127.0.6533.89 (Official Build) (64-bit)

  • 🇫🇷France flocondetoile Lyon

    Which theme is used ? Which module (custom/contrib) with JS stuff is loaded on the page ?

  • 🇫🇷France mably

    You could also give a quick try to the brand new 3.0.x-dev version which is theoretically more compatible with dynamic pages (Ajax).

  • 🇫🇷France flocondetoile Lyon

    With Olivero theme, I don't reproduce it.

  • 🇫🇷France flocondetoile Lyon

    I guess the two (or X) back to top label are added because there is an ajax Refresh request done on the page. Or may be because of Big Pipe. If so try to disable Big Pipe to see if the rrot cause comes from here.

  • 🇬🇧United Kingdom SirClickALot Somerset

    Ah ha!
    Unistalling Big Pipe does indeed fix the issue for me.

  • 🇬🇧United Kingdom SirClickALot Somerset

    I can also confirm that 3.0.x-dev also works with Big Pipe active ;-)

  • 🇫🇷France flocondetoile Lyon

    Unistalling big pipe is not a solution, indeed. But we knows that the duplicate links are because of the multiple ajax request done on the page by Big Pipe.

  • Status changed to Fixed 4 months ago
  • 🇫🇷France mably

    Confirmed as fixed in 3.0.x-dev.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024