1.15.0 Breaking Changes
-
middleware.checkGlobalPrivacySettings
removed, either usemiddleware.canViewUsers
ormiddleware.canViewGroups
feat: remove deprecated checkGlobalPrivacySettings · NodeBB/NodeBB@0cea713
Node.js based forum software built for the modern web - feat: remove deprecated checkGlobalPrivacySettings · NodeBB/NodeBB@0cea713
GitHub (github.com)
-
await topics.async.getTopicData(tid)
usage is removed, useawait topics.getTopicData(tid)
ortopics.getTopicData(tid, callback)
feat: remove topics.async.getTopicData usage · NodeBB/NodeBB@ce6b20c
Node.js based forum software built for the modern web - feat: remove topics.async.getTopicData usage · NodeBB/NodeBB@ce6b20c
GitHub (github.com)
-
utils.walk
was deprecated and removed in 1.15.0, usefile.walk
instead.feat: remove deprecated utils.walk · NodeBB/NodeBB@609e37a
Node.js based forum software built for the modern web - feat: remove deprecated utils.walk · NodeBB/NodeBB@609e37a
GitHub (github.com)
-
/assets/stylesheet.css
route was deprecated and removed in 1.15.0. If you have a theme that is still using this change it to/assets/client.css
for the front end and/assets/admin.css
for the ACP. https://github.com/NodeBB/NodeBB/commit/762b0be4b4744abef16873abd08cca2133bb159b -
Requiring core modules with
module.parent.require()
will not work if the path to the module is not correct. Please userequire.main.require("./src/<module_name>")
instead which will work regardless of where you source file is in the plugin folder structure. https://github.com/NodeBB/NodeBB/commit/303bffdb5f7e7e048c4e019f128b3a42c9362aa8 -
The method signature of
Flags.list()
has changed. Instead of(filters<object>, uid<int>)
, it now takes a single object parameter, with valid properties beingfilters
,uid
, andsort
-
This effects custom themes.
https://github.com/NodeBB/NodeBB/issues/8615The necessary changes are in this commit to persona theme. https://github.com/NodeBB/nodebb-theme-persona/commit/4dcc9fad23eed806604397292a2d8117f1052320
-
sounds removed https://github.com/NodeBB/NodeBB/pull/8617
app.isConnected
has been removed, usesocket.connected
instead.
app.template
has been removed, useajaxify.data.template.name
instead
window.templates
global has been removed, use benchpress by requiring it as a module.
RELATIVE_PATH
global has been removed, usedconfig.relative_path
instead -
utils.slugify
deprecated in 1.15.0, will be removed in 1.16.0. Use theslugify
module that will be available in 1.15.0.Client side
require(['slugify'], function (slugify) { console.log(slugify('string to slugify')); });
Server side
const slugify = require.main.require('./src/slugify'); console.log(slugify('string to slugify'));
-
The Write API plugin has been merged into core NodeBB and given the prefix
/v3
. The pre-existing write-api plugin should still work with NodeBB v1.15.x (and/v2
will be entering maintenance), but development will continue on/v3
Breaking and Non-Breaking changes
- Not Breaking
POST /api/v1/users | admin.user.createUser
- The POST route will now return a complete user object (a call to User.getUserData is made with the new uid)
- Not Breaking
PUT /api/v1/users/:uid | SocketUser.changeUsernameEmail | SocketUser.updateProfile
- The PUT route will now return a complete user object (like above)
- Breaking
DELETE /api/v1/users | DELETE /api/v1/users/:uid | admin.user.deleteUserAndContent
- The new
DELETE
route will now not return anything in response
- The new
- Breaking
PUT /api/v1/categories/:cid | admin.categories.update
- The new
PUT
route will return the updated category object, instead of simply the cid that was updated
- The new
- Breaking
POST /api/v1/groups | admin.groups.create
- The
POST
route will now return a complete group object (a call to Groups.getGroupData is made with the new group name) ownerUid
, previously returned, will now no longer be present in the response
- The
- Breaking
PUT/DELETE /api/v1/groups/:slug/membership
- Updated to be
PUT/DELETE /api/v1/groups/:slug/membership/:uid
, to better conform with RESTful API design (it takesuid
as a route param now) - Admin-only Write API routes for group addition/removal have been merged into this one route
- Updated to be
- Not Breaking
POST /api/v1/topics/:tid | posts.reply
- The
POST
route will now return a complete post summary object instead of a smaller subset as before
- The
- Not Breaking
PUT /api/v1/posts/:pid
- The
PUT
route will now return a complete post summary object instead of a smaller subset as before
- The
- Breaking
api/v1/categories/:cid/privileges
route has been removed in favour ofapi/v3/users/:uid/privileges
andapi/v3/groups/:name/privileges
- Breaking
api/v1/categories/:cid/state
removed as category disabled state is slated for removal in a future version of NodeBB - Breaking
api/v2/util/maintenance
is renamedapi/v3/admin/settings
and now allows modification of all ACP settings - Breaking
api/v2/util/upload
is renamedapi/v3/files/upload
- Not Breaking
-
@baris said in 1.15.0 Breaking Changes:
utils.slugify
deprecated in 1.15.0, will be removed in 1.16.0. Use theslugify
module that will be available in 1.15.0.Client side
require(['slugify'], function (slugify) { console.log(slugify('string to slugify')); });
Server side
const slugify = require('slugify'); console.log(slugify('string to slugify'));
Hello @baris !
I began to upgrade nodebb from 1.14 to 1.15 and, when I use these changes for slugify in my plugins, I get this error :
2020-12-11T14:23:34.787Z [5678/37554] - error: Error: Cannot find module 'slugify'
These changes for slugify are for nodebb 1.15 or nodebb 1.16 ? Or is it something else that I must do to make it works right ?
-
@baris said in 1.15.0 Breaking Changes:
Slugify module was added in 1.15.0, utils.slugify is being removed in 1.16.0. Check if you have slugify.js in
public/src/modules
and post how you are requiring the module.Hello @baris,
I have slugify.js in public/src/modules .
I require module in my library.js of my plugin like you said :
const slugify = require('slugify'); console.log(slugify('string to slugify'));
and it gives :
2020-12-12T11:40:23.482Z [5678/68409] - error: Error: Cannot find module 'slugify' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18)
...