NodeBB with Redactor: Can't Reply Topic Opened in New Tab

Bug Reports
  • On our site at https://community.troikatronix.com we continue to use Redactor with NodeBB 1.17.2

    For a logged in user, if you:

    1. Go to the forum
    2. Click a topic to open it
    3. Hit the blue "Reply" button

    Redactor opens fine and you can type your reply, etc.

    But if you

    1. Go to the forum
    2. Right click a topic and say "open in new tab" – which causes the topic to open in a new tab (obviously)
    3. Hit "Reply"

    There is no response.

    This happens on Safari, Chrome and Firefox.

    In both cases the button;s HREF is something like

    https://community.troikatronix.com/compose?tid=XXXX&title=Post Title

    Why does this work when you go into the topic directly and not work when you open it in a new tab?

    Best Wishes,
    Mark

  • Hi @mark-coniglio -- it looks like you have some bad javascript added in the footer.tpl

    I see this error on cold load:

    Uncaught TypeError: signupButton is null
        prepareFooter https://community.troikatronix.com/topic/7494/keep-actors-values-in-and-out-synced-data-array/8:1922
        EventListener.handleEvent* https://community.troikatronix.com/topic/7494/keep-actors-values-in-and-out-synced-data-array/8:1914
    

    Specifically, these lines added:

    const signupButton = document.querySelector("#logged-out-menu li:nth-child(1) span");
    signupButton.innerHTML = "Register";
    
    const loginButton = document.querySelector("#logged-out-menu li:nth-child(2) span");
    loginButton.innerHTML = "Login to Forum";
    

    signupButton can be undefined if it does not exist in the DOM.


Suggested Topics


  • 0 Votes
    1 Posts
    160 Views

    Here
    I am calling this api (topic details api)http://localhost:4567/api/topic/{topic_id}/{topic_slug}
    from my proxy and it will always increases the viewcount.

    Example:

    app.get('/check', (req,res)=> { const options = { url: 'http://localhost:4567/api/topic/11/testCount', method: 'GET', json: true }; request(options, (error, response, body) => { res.send(body) }) })

    this is my CUrl

    curl --location --request GET 'http://localhost:3002/check' \ --header 'Authorization: Bearer 5e8db636-89ec-41ea-9cf9-8309297f8ac4'

    How can I get the correct viewcount.?
    can anyone help on this?

  • 0 Votes
    13 Posts
    3k Views

    I previously had this issue. It only affects admins who have the rights to change the order of the pinned topics which is why it's unlikely others can't reproduce on the OPs site.
    However since 1.7 (could be Chrome 64) I no longer have the problem.

  • 0 Votes
    5 Posts
    2k Views

    Thank you for the work, @baris

    Edit: Can confirm that this is fixed. The topic can be closed (if needed)

  • 0 Votes
    2 Posts
    911 Views

    Hi, you might have a mismatched version of NodeBB core and Lavender/Vanilla. Can you post the result of git rev-parse HEAD for core, as well as your Lav/Vanilla versions please?

  • 0 Votes
    5 Posts
    2k Views

    @Guiri I see, I have solved.
    But I have some problems, I don't know which database I should use.
    mongo or redis ?