• 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

Object #<Object> has no method 'indexOf'

Scheduled Pinned Locked Moved Technical Support
18 Posts 3 Posters 4.8k 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.
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by
    #1

    Hi.. my v.0.9.x start to throw some errors on some recent topics. as show below:

    Its not related to any plugin and i saw that this kind of error started when i changed to 0.9.x

    17/11 11:51 [14172] - error: TypeError: Object #<Object> has no method 'indexOf'
    at async.waterfall.data.privileges (/home/forum/NodeBB/src/controllers/topics.js:177:19)
    at fn (/home/forum/NodeBB/node_modules/async/lib/async.js:717:34)
    at /home/forum/NodeBB/node_modules/async/lib/async.js:1170:16
    at /home/forum/NodeBB/node_modules/async/lib/async.js:172:37
    at /home/forum/NodeBB/node_modules/async/lib/async.js:677:43
    at /home/forum/NodeBB/node_modules/async/lib/async.js:173:37
    at Object._onImmediate (/home/forum/NodeBB/node_modules/async/lib/async.js:1163:34)
    at processImmediate [as _immediateCallback] (timers.js:363:15)
    TypeError: Object #<Object> has no method 'indexOf'
    at async.waterfall.data.privileges (/home/forum/NodeBB/src/controllers/topics.js:177:19)
    at fn (/home/forum/NodeBB/node_modules/async/lib/async.js:717:34)
    at /home/forum/NodeBB/node_modules/async/lib/async.js:1170:16
    at /home/forum/NodeBB/node_modules/async/lib/async.js:172:37
    at /home/forum/NodeBB/node_modules/async/lib/async.js:677:43
    at /home/forum/NodeBB/node_modules/async/lib/async.js:173:37
    at Object._onImmediate (/home/forum/NodeBB/node_modules/async/lib/async.js:1163:34)
    at processImmediate [as _immediateCallback] (timers.js:363:15)
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

    What git hash are you on?

    1 Reply Last reply
    1
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by
    #3

    Seems like topic titles with Á É é á are crashing..

    My last git log entry:

    commit cee3918e9b8096e421933678178ddfe4e3b71adf
    Author: Julian Lam <[email protected]>
    Date:   Sun Nov 8 11:57:18 2015 -0500
    
    fixing crash on settings save
    
    barisB 1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by baris
    #4

    I will take a look.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    replied to Leonardo Galani on last edited by
    #5

    @Leonardo-Galani Can you do me a favor and add the below code in src/controllers/topics.js

    console.log(ogImageUrl, topicData.thumb);
    

    Add it at line 176 and let me know the output of the log after you get the crash.

    1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by Leonardo Galani
    #6

    @baris The output is this (just before* the crash)

      { email: '[email protected]' } undefined
    

    on another post:

    { email: '[email protected]' } undefined
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #7

    Looks like ogImageUrl is set to an object where it should just be a string. Do you have a profile image plugin or something? I'm guessing a plugin is setting postAtIndex.user.picture to { email: '[email protected]' } which is causing the crash.

    L 1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    replied to <baris> on last edited by
    #8

    @baris
    No, im not using any avatar profile img plugin...

    Those are the ones installed and running:

     - nodebb-widget-essentials
     - nodebb-plugin-cards
     - nodebb-plugin-composer-default
     - nodebb-plugin-dbsearch
     - nodebb-plugin-desktop-notifications
     - nodebb-plugin-emailer-mailgun
     - nodebb-plugin-google-analytics
     - nodebb-plugin-markdown
     - nodebb-plugin-recent-cards
     - nodebb-plugin-rss
     - nodebb-plugin-soundpack-default
     - nodebb-plugin-spoilers
     - nodebb-plugin-sso-google
     - nodebb-rewards-essentials
     - nodebb-plugin-sso-facebook
     - nodebb-plugin-mentions
     - nodebb-plugin-custom-pages
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #9

    In that case can you change the console.log to console.log(ogImageUrl, postAtIndex); and post the log when it crashes.

    L 1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    replied to <baris> on last edited by
    #10

    @baris

    { email: '[email protected]' } { _key: undefined,
      pid: 931,
      uid: 466,
      tid: 286,
      content: '<ul>\n<li>O plano não funciona, o planejamento sim, os projetos hoje em dia não permitem que fiquemos apenas na divagação de “fazer planos”, que na maioria dos casos não serão implementadas. Tudo começa pela definição dos objetivos que não..........,
      timestamp: 1447772189409,
      reputation: 0,
      votes: 0,
      editor: null,
      edited: 0,
      deleted: false,
      relativeTime: '2015-11-17T14:56:29.409Z',
      relativeEditTime: '',
      index: 0,
      user:
        { _key: undefined,
          username: 'Oscar Correia',
          userslug: 'oscar-correia',
          email: undefined,
          picture: { email: '[email protected]' },
          fullname: '',
          signature: '',
          uploadedpicture: undefined,
          reputation: -3,
          postcount: 9,
          banned: false,
     ..... },
       favourited: false,
       upvoted: false,
       downvoted: false,
       selfPost: false,
       display_moderator_tools: true,
       display_move_tools: false }
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #11

    @Leonardo-Galani said:

    picture: { email: '[email protected]' },

    Shouldn't be an object, not sure why it's set to one though.

    Run grep -R "filter:user.getPicture" node_modules/ in your nodebb folder and see if there are any matches.

    1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by Leonardo Galani
    #12

    @baris

    No matches 😕

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #13

    Then I am officially out of ideas, you can set those users picture and uploaded picture property to an empty string through mongodb, and let them set their picture again.

    See if that helps. I also added a check on master that should prevent the crash, but it still doesn't explain the issue of the picture property being an object.

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to <baris> on last edited by
    #14

    @baris Maybe it's an SSO issue? Something like the SSO is returning an object for the image instead of a link to the image?

    barisB 1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    replied to PitaJ on last edited by baris
    #15

    @pitaj Yeah that makes sense I checked the sso-facebook and google plugins, they are saving the picture field but there are no checks if the data is a string or object.

    https://github.com/julianlam/nodebb-plugin-sso-google/blob/master/library.js#L120-L123

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to <baris> on last edited by
    #16

    @baris yeah I'm thinking it's Facebook since the given email is a hotmail address.

    1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by
    #17

    He used to have a image ( this user ) .. i will try to add something and delete to check it.

    L 1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    replied to Leonardo Galani on last edited by
    #18

    @Leonardo-Galani YEP... avatar removed.. and post now working fine...

    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