Problems after upgrading forum

Technical Support
  • db.objects.find({_key: "navigation:enabled"});
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcb2"), "_key" : "navigation:enabled", "value" : "{"8":{"iconClass":"fa-navicon","route":"/home","title":"","text":"","textClass":"","id":"","enabled":"","properties":{}}}", "score" : 8 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcb1"), "_key" : "navigation:enabled", "value" : "{"7":{"iconClass":"fa-cogs","route":"/admin","title":"[[global:header.admin]]","text":"[[global:header.admin]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"adminOnly":true}}}", "score" : 7 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcb0"), "_key" : "navigation:enabled", "value" : "{"6":{"iconClass":"fa-group","route":"/groups","title":"[[global:header.groups]]","text":"[[global:header.groups]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"adminOnly":true}}}", "score" : 6 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcaf"), "_key" : "navigation:enabled", "value" : "{"5":{"iconClass":"fa-user","route":"/users","title":"[[global:header.users]]","text":"[[global:header.users]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"loggedIn":true}}}", "score" : 5 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcae"), "_key" : "navigation:enabled", "value" : "{"4":{"iconClass":"fa-fire","route":"/popular","title":"[[global:header.popular]]","text":"[[global:header.popular]]","textClass":"visible-xs-inline","id":"","enabled":"","properties":{}}}", "score" : 4 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcad"), "_key" : "navigation:enabled", "value" : "{"3":{"iconClass":"fa-tags","route":"/tags","title":"[[global:header.tags]]","text":"[[global:header.tags]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}", "score" : 3 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcac"), "_key" : "navigation:enabled", "value" : "{"2":{"iconClass":"fa-clock-o","route":"/recent","title":"[[global:header.recent]]","text":"[[global:header.recent]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"loggedIn":true}}}", "score" : 2 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcab"), "_key" : "navigation:enabled", "value" : "{"1":{"iconClass":"fa-inbox","route":"/unread","title":"[[global:header.unread]]","text":"[[global:header.unread]]","textClass":"visible-xs-inline","id":"unread-count","enabled":"true","properties":{"loggedIn":true}}}", "score" : 1 }
    { "_id" : ObjectId("5a78ae3d4e5630d93334dcaa"), "_key" : "navigation:enabled", "value" : "{"0":{"iconClass":"fa-list","route":"/categories","title":"Forums","text":"Forums","textClass":"","id":"","enabled":"true","properties":{}}}", "score" : 0 }

  • @jonomx3 Your data looks fine, so it is weird that you are getting that error message. Can you put console.log(data.enabled); before

    line and load the admin navigation page again. Let me know what it ouputs to the server side logs. One of the navigation items seem to be undefined.

  • @baris Here is the console output after adding that line:

    [ { iconClass: 'fa-list',
    route: '/categories',
    title: 'Forums',
    text: 'Forums',
    textClass: '',
    id: '',
    enabled: 'true',
    properties: {} },
    undefined,
    undefined,
    undefined,
    undefined,
    undefined,
    undefined,
    undefined,
    undefined,
    undefined ]

  • Thanks. Let's dig a little deeper, can you put console.log(data) before this line

  • I noticed the db query you ran only returned 9 navigation elements but the console.log you added returned an array of 10 elements. So there is something else going on. The above console.log will tell us more. Does the first query still return 9 elements?

  • Here is the additional log output, I think I can see the issue here, is it possible I have two entries from the /categories menu both with the index of 0?

    [ '{"0":{"iconClass":"fa-list","route":"/categories","title":"Forums","text":"Forums","textClass":"","id":"","enabled":"true","properties":{}}}',
    '{"0":{"iconClass":"fa-list","route":"/categories","title":"[[global:header.categories]]","text":"[[global:header.categories]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}',
    '{"1":{"iconClass":"fa-inbox","route":"/unread","title":"[[global:header.unread]]","text":"[[global:header.unread]]","textClass":"visible-xs-inline","id":"unread-count","enabled":"true","properties":{"loggedIn":true}}}',
    '{"2":{"iconClass":"fa-clock-o","route":"/recent","title":"[[global:header.recent]]","text":"[[global:header.recent]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"loggedIn":true}}}',
    '{"3":{"iconClass":"fa-tags","route":"/tags","title":"[[global:header.tags]]","text":"[[global:header.tags]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}',
    '{"4":{"iconClass":"fa-fire","route":"/popular","title":"[[global:header.popular]]","text":"[[global:header.popular]]","textClass":"visible-xs-inline","id":"","enabled":"","properties":{}}}',
    '{"5":{"iconClass":"fa-user","route":"/users","title":"[[global:header.users]]","text":"[[global:header.users]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"loggedIn":true}}}',
    '{"6":{"iconClass":"fa-group","route":"/groups","title":"[[global:header.groups]]","text":"[[global:header.groups]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"adminOnly":true}}}',
    '{"7":{"iconClass":"fa-cogs","route":"/admin","title":"[[global:header.admin]]","text":"[[global:header.admin]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"adminOnly":true}}}',
    '{"8":{"iconClass":"fa-navicon","route":"/home","title":"","text":"","textClass":"","id":"","enabled":"","properties":{}}}' ]

  • Yeah so you seem to have 2 identical nav items.

    [ '{"0":{"iconClass":"fa-list","route":"/categories","title":"Forums","text":"Forums","textClass":"","id":"","enabled":"true","properties":{}}}',
    '{"0":{"iconClass":"fa-list","route":"/categories","title":"[[global:header.categories]]","text":"[[global:header.categories]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}',
    

    Which is causing the issue, can you run db.objects.find({_key: "navigation:enabled"}); again and make sure it is running on the database that your forum is using.

  • Ah, sorry about that, that first command was run on the backup DB!

    After running it on the correct one 😏 I get this output:

    { "_id" : ObjectId("5a78d01c4e5630d933353da6"), "_key" : "navigation:enabled", "value" : "{"8":{"iconClass":"fa-navicon","route":"/home","title":"","text":"","textClass":"","id":"","enabled":"","properties":{}}}", "score" : 8 }

    { "_id" : ObjectId("5a78d01c4e5630d933353da5"), "_key" : "navigation:enabled", "value" : "{"7":{"iconClass":"fa-cogs","route":"/admin","title":"[[global:header.admin]]","text":"[[global:header.admin]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"adminOnly":true}}}", "score" : 7 }

    { "_id" : ObjectId("5a78d01c4e5630d933353da4"), "_key" : "navigation:enabled", "value" : "{"6":{"iconClass":"fa-group","route":"/groups","title":"[[global:header.groups]]","text":"[[global:header.groups]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"adminOnly":true}}}", "score" : 6 }

    { "_id" : ObjectId("5a78d01c4e5630d933353da3"), "_key" : "navigation:enabled", "value" : "{"5":{"iconClass":"fa-user","route":"/users","title":"[[global:header.users]]","text":"[[global:header.users]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"loggedIn":true}}}", "score" : 5 }

    { "_id" : ObjectId("5a78d01c4e5630d933353da2"), "_key" : "navigation:enabled", "value" : "{"4":{"iconClass":"fa-fire","route":"/popular","title":"[[global:header.popular]]","text":"[[global:header.popular]]","textClass":"visible-xs-inline","id":"","enabled":"","properties":{}}}", "score" : 4 }

    { "_id" : ObjectId("5a78d01c4e5630d933353da1"), "_key" : "navigation:enabled", "value" : "{"3":{"iconClass":"fa-tags","route":"/tags","title":"[[global:header.tags]]","text":"[[global:header.tags]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}", "score" : 3 }

    { "_id" : ObjectId("5a78d01c4e5630d933353da0"), "_key" : "navigation:enabled", "value" : "{"2":{"iconClass":"fa-clock-o","route":"/recent","title":"[[global:header.recent]]","text":"[[global:header.recent]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{"loggedIn":true}}}", "score" : 2 }

    { "_id" : ObjectId("5a78d01c4e5630d933353d9f"), "_key" : "navigation:enabled", "value" : "{"1":{"iconClass":"fa-inbox","route":"/unread","title":"[[global:header.unread]]","text":"[[global:header.unread]]","textClass":"visible-xs-inline","id":"unread-count","enabled":"true","properties":{"loggedIn":true}}}", "score" : 1 }

    { "_id" : ObjectId("5a78d01c4e5630d933353d9e"), "_key" : "navigation:enabled", "value" : "{"0":{"iconClass":"fa-list","route":"/categories","title":"[[global:header.categories]]","text":"[[global:header.categories]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}", "score" : 0 }

    { "_id" : ObjectId("5a78ae3d4e5630d93334dcaa"), "_key" : "navigation:enabled", "value" : "{"0":{"iconClass":"fa-list","route":"/categories","title":"Forums","text":"Forums","textClass":"","id":"","enabled":"true","properties":{}}}", "score" : 0 }

    So is the best solution to remove this line from the DB:

    { "_id" : ObjectId("5a78d01c4e5630d933353d9e"), "_key" : "navigation:enabled", "value" : "{"0":{"iconClass":"fa-list","route":"/categories","title":"[[global:header.categories]]","text":"[[global:header.categories]]","textClass":"visible-xs-inline","id":"","enabled":"true","properties":{}}}", "score" : 0 }

  • Ok so I removed one of the conflicting DB entries and this has now fixed the issue.

    Thank you so much for your help. 😀

    Jon

  • Glad to hear it is resolved.


Suggested Topics