Register a hook but lose another hook
Solved
Technical Support
-
Okay, so I'm experiencing something weird here.
First thing first, my repo: https://github.com/ducntq/nodebb-theme-devmonkeeI got 2 hooks in my plugin.json:
"hook": "filter:privileges.topics.get", "method": "onGetTopicPrivSettings", "hook": "static:api.routes", "method": "addRoutes"
These hooks are served by
/lib/theme.js
.
The problem is:- If I register
static:api.routes
, the hookfilter:privileges.topics.get
will not register. - If I don't register
static:api.routes
(aka remove fromplugin.json
),filter:privileges.topics.get
will be registered.
Can someone please tell me what's going on? Why can't I register both
static:api.routes
andfilter:privileges.topics.get
? - If I register
-
Each hook definition needs to be in a separate object, right now they're all in the same one so only the last is used.
You need to have something like:
{ "hook": ..., "method": ... }, { "hook": ..., "method": ... }, etc
Copyright © 2024 NodeBB | Contributors