nodebb-plugin-category-sections - ACP still broken
-
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 insections.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 port4568
-
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 runDEL plugins:category-sections:sections
to remove any saved settingsadd 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.