• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

voting not working

Scheduled Pinned Locked Moved NodeBB Development
10 Posts 4 Posters 2.7k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by
    #1

    I want to vote a post in my nodebb, but nothing happen, no error log.
    how can I debug?

    1 Reply Last reply
    2
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #2

    Hi there,

    Can you please provide the following information to help us debug?

    1. Server or client operating system (if applicable)
    2. NodeBB version and hash
      • To get the hash, run git rev-parse HEAD from the root of your NodeBB folder
    3. If applicable, theme versions
      • npm ls nodebb-theme-persona
    4. Do you see any errors in the client-side?

    Thanks!

    1 Reply Last reply
    0
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by
    #3
    1. CentOS release 6.6 (Final)

    2. #git rev-parse HEAD
      d9af2242a7c7fc92318a83bd46e4f849094960f2

    3. I am not using nodebb-theme-persona, but nodebb-theme-lavender.

    4. error at client-side
      "Error
      Invalid Data"

    1 Reply Last reply
    0
  • psychobunnyP Offline
    psychobunnyP Offline
    psychobunny
    wrote on last edited by psychobunny
    #4

    This rings a bell, I think I fixed this recently. Can you update to latest 0.7x and latest lavender and let me know?

    EDIT: lav's dependant on vanilla as well so update that too please

    1 Reply Last reply
    0
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by
    #5

    I had changed to nodebb-theme-persona, it has the same problem.

    1 Reply Last reply
    0
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by
    #6

    I found the error is come from favouriteCommand, and added some debug output:

        function favouriteCommand(socket, command, eventName, notification, data, callback) {
        winston.info('command=`' + JSON.stringify(command) );
        winston.info('eventName=`' + JSON.stringify(eventName) );
        winston.info('notification=`' + JSON.stringify(notification) );
        winston.info('data=`' + JSON.stringify(data) );
    
            if(!data || !data.pid || !data.room_id) {
        winston.error('favouriteCommand invalid-data');
                return callback(new Error('[[error:invalid-data]]'));
            }
    
    1 Reply Last reply
    0
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by Rex Huang
    #7

    the debug output as below:

    4/6 03:55 [387] - info: command=`"upvote"
    4/6 03:55 [387] - info: eventName=`"voted"
    4/6 03:55 [387] - info: notification=`"notifications:upvoted_your_post_in"
    4/6 03:55 [387] - info: data=`{"pid":"85","room_id":""}
    4/6 03:55 [387] - error: favouriteCommand invalid-data
    

    Does anyone have idea what's going wrong?

    1 Reply Last reply
    0
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by
    #8

    temp solution:

    -- 	if(!data || !data.pid || !data.room_id) {
    ++ if(!data || !data.pid) {
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #9

    That's weird the room_id should be something like topic_<topic_id> where topic_id is the id of the topic you are in.

    When this happens what is the value of app.currentRoom client side?

    1 Reply Last reply
    0
  • Rex HuangR Offline
    Rex HuangR Offline
    Rex Huang Gamers
    wrote on last edited by
    #10

    The code is in src/socket.io/posts.js, but I can't find the topic_id and app.currentRoom you mention.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development