nodebb-plugin-category-sections - ACP still broken

Plugin Requests
  • DISCLAIMER: First post here, I discovered nodebb less than 24 hours ago and my node.js experience is fairly limited. If I'm missing something blatantly obvious, forgive the noob in me. 😉 All in all the forum software is brilliantly executed as far as I can see, and doesn't suffer from the same issues as Discourse concerning extensibility. Well played devs. 👍

    So, there doesn't appear to be a centralized topic for this particular plugin, so I thought I'd create a new topic.

    Here's the issue: The category sections plugin (IMHO) is pretty core for forum functionality. I'd love to use the plugin but sadly it doesn't appear to be working with 1.x.x

    I've already installed Lavendar as the base theme. I've attempted to use this fork of the main git as it was updated 15 days ago. Seeing as 1.x.x was released 16 days ago, you'd assume this would resolve the issue at hand... But it doesn't appear to.

    I'm getting no in-browser js errors, and I'm just getting a generic The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. * nodebb-plugin-category-sections from the log.

    It's really strange, since sections.js doesn't seem to be executing client-side at all. No errors, click and drag functionality is non-existent, and there's no event listener attached to the buttons despite them being declared via jQuery in sections.js.

    category-sections.tpl IS loading in the ACP, but the "Add Section" button does nothing and there's no click and drag functionality.

    Strangely, hitting "Save Sections" DOES have an effect as the homepage will go entirely blank when clicked (Assuming that no sections = no content on the homepage)

    @psychobunny, I'm sure you're super busy with all the awesomeness happening here with nodebb, but perhaps you have some thoughts into your brainchild here?

    As I've stated, I'm less than 24 hours into exploring nodebb and I'm at a complete loss as to what's occurring here to prevent ACP functionality. Thanks for any insights you all could provide here.

    Few Notes

    • I'm running a DO droplet, Ubuntu 14.04, there are no conflicting containers, app was installed via NPM, server is up to date and the application is running naked, no docker.
    • There's not a FQDN attached to the instance of nodebb however. config.json is using the static IP of the VPS, and I'm running nodebb on port 4568
  • I spun up a test instance of NodeBB running 1.x, and pulled from @psychobunny's actual repo. Recieved a bombartment of errors logged to browser console, but no issues logged in terminal when running NodeBB under ./nodebb dev You can view my browser's log on this raw pastebin link.

  • Hmm... Weird. Why am I not seeing any of this in my browser's console?

    I can confirm with the neutrino84 forked git that ./nodebb dev doesn't spit anything out in the terminal either.

    'Tis a puzzlement.

  • I'll see if I can pull a log from that fork today for you. Personally, I'm a fan of tabs, so if like to see this working with some js to turn these sections into tabs.

  • @Jason-Neal the plugin is not updated for NodeBB v1.0. There was a change in NodeBB v1.0 related to ACP scripts for plugins.

    Sent a PR to make it compatible with NodeBB v1.x.x

    In the mean time to make the ACP work, change this line

    https://github.com/NodeBB/nodebb-plugin-category-sections/blob/master/plugin.json#L24

    replace "scripts" with "acpScripts" and then restart NodeBB.

  • @pichalite, my test board seems to crash when this plugin is activated now.

    Issues I noticed:

    • Making the change in your PR to the plugin.json allowed the use of the buttons in the ACP
    • Trying to add more than one category and hitting save resulted in content a message reading "ERR" being shown
    • After disabling the plugin and re-enabling it, the board crashes as soon as it is activated.

    As soon as I try to open category sections from within the ACP

    17/3 16:27 [14512] - verbose: [plugins] Loading templates (nodebb-plugin-category-sections)
    17/3 16:27 [14512] - verbose: [meta/templates] Compiling templates
    17/3 16:27 [14512] - verbose: [meta/templates] Successfully compiled templates.
    17/3 16:27 [14512] - error: SyntaxError: Unexpected token o
        at Object.parse (native)
        at Command.callback (/root/nodebb/node_modules/nodebb-plugin-category-sections/library.js:71:53)
        at RedisClient.return_reply (/root/nodebb/node_modules/redis/index.js:664:25)
        at JavascriptReplyParser.reply_parser.send_reply (/root/nodebb/node_modules/redis/index.js:332:14)
        at JavascriptReplyParser.run (/root/nodebb/node_modules/redis/lib/parsers/javascript.js:132:18)
        at JavascriptReplyParser.execute (/root/nodebb/node_modules/redis/lib/parsers/javascript.js:107:10)
        at Socket.<anonymous> (/root/nodebb/node_modules/redis/index.js:131:27)
        at Socket.emit (events.js:95:17)
        at Socket.<anonymous> (_stream_readable.js:764:14)
        at Socket.emit (events.js:92:17)
    SyntaxError: Unexpected token o
        at Object.parse (native)
        at Command.callback (/root/nodebb/node_modules/nodebb-plugin-category-sections/library.js:71:53)
        at RedisClient.return_reply (/root/nodebb/node_modules/redis/index.js:664:25)
        at JavascriptReplyParser.reply_parser.send_reply (/root/nodebb/node_modules/redis/index.js:332:14)
        at JavascriptReplyParser.run (/root/nodebb/node_modules/redis/lib/parsers/javascript.js:132:18)
        at JavascriptReplyParser.execute (/root/nodebb/node_modules/redis/lib/parsers/javascript.js:107:10)
        at Socket.<anonymous> (/root/nodebb/node_modules/redis/index.js:131:27)
        at Socket.emit (events.js:95:17)
        at Socket.<anonymous> (_stream_readable.js:764:14)
        at Socket.emit (events.js:92:17)
    
  • @ThingBreaker may be there is some error if using Redis as DB. I have no problems running it using Mongo.

    Will try to spin a new instance using Redis and see if it works.

  • @pichalite, I'd be curious to hear your results. I haven't worked with mongo previously though it seems to be the new standard for NodeBB installations.

  • @ThingBreaker I am getting the same error if I use Redis. not sure what the fix is...

  • @ThingBreaker I think I found a fix for this...

    remove existing plugin settings from Redis (if any saved)

    connect to redis using redis-cli and run DEL plugins:category-sections:sections to remove any saved settings

    add the following code before this line https://github.com/NodeBB/nodebb-plugin-category-sections/blob/master/static/lib/admin/sections.js#L66

    sections = JSON.stringify(sections);

    restart NodeBB

  • I have to say, I'm loving the active community here for NodeBB. Reminds me of when SMF was still pretty new. 👍

    Would it help if I forked the repository, made the fix and asked for a pull into the master?

    Not sure about the order of operations expected here in the community.

  • @Jason-Neal already sent the PR to the repository. no need to do it again.

  • @Jason-Neal @ThingBreaker new version of plugin published with compatibility for NodeBB v1.x.x and fix for settings save when using redis.

  • @pichalite You're awesome man.

    Very excited about nodebb and what it can do.

    I look forward to becoming an active part of the community here. 👍

    Kudos to @psychobunny for all of the AWESOME plugins he's developed here too! 💯

  • Don't think starting a new topic is necessary for my question - is this only compatible with Lavender and if not is there a way of doing this with Persona?

  • @Danny-McWilliams said:

    is this only compatible with Lavender and if not is there a way of doing this with Persona?

    seems to be compatible with persona, but I haven't tried it
    https://github.com/NodeBB/nodebb-plugin-category-sections/blob/master/library.js#L136

  • @phit @Danny-McWilliams plugin used to support persona but recent changes to persona/templates.js made it incompatible.


Suggested Topics


  • 1 Votes
    1 Posts
    52 Views

    Ko-Fi is a simple donation platform that allows people to send tip without too much hassle.

    While they do not have full blown API, they do have webhook that we can redirect to our own endpoints.

    Here's an example of the data that will be sent for a single donation:

    data = { "verification_token": "8c2a3835-4544-4f27-a53a-adfd1fcc5664", "message_id": "b54fa6ec-07c9-44aa-be0e-b0f4095d9145", "timestamp": "2023-07-29T16:27:32Z", "type": "Donation", "is_public": true, "from_name": "Jo Example", "message": "Good luck with the integration!", "amount": "3.00", "url": "https://ko-fi.com/Home/CoffeeShop?txid=00000000-1111-2222-3333-444444444444", "email": "[email protected]", "currency": "USD", "is_subscription_payment": false, "is_first_subscription_payment": false, "kofi_transaction_id": "00000000-1111-2222-3333-444444444444", "shop_items": null, "tier_name": null, "shipping": null }

    Would be nice if NodeBB have plugin that can act as endpoint so we can hook right here on our Ko-Fi profile
    55224b71-5ae6-499d-97f9-7474ab9cd3f1-image.png

    And have it lists our donators on a page in mysite.com/donators sorted by date descending.

  • Video Plugin

    Plugin Requests
    1 Votes
    1 Posts
    422 Views

    Does anyone know of a plugin to embed uploaded videos? I enabled file uploads on my forum, but they just show up as links. Would like an embedded video player. Tried the plugin search, but the 2 it found did not work.

  • 0 Votes
    2 Posts
    1k Views

    If It involves only two layers of father son relationship, I am check they category.parent, I haved implemented the function, I wonder if this method is advisable.
    [email protected]

  • 0 Votes
    17 Posts
    3k Views

    I recently updated the dice-bot plugin to 1.1.0

  • Post Reactions Plugin

    Plugin Requests
    1 Votes
    3 Posts
    2k Views

    cool idea...