Gotchas for v0.5.0
-
Another minor version, another slew of breaking changes
Keep in mind v0.4.3 was released today, so v0.5.0 is 2-4 weeks out.
Here's v0.5.0's list of breaking changes:
- The privileges system got a bit of a rewrite (+ UI revamp!), and almost all privileges have been renamed (issue #933):
- Migration Steps
+r
has becomeread
+w
has split intotopics:create
andtopics:reply
g+r
has becomegroups:read
g+w
has split intogroups:topics:create
andgroups:topics:reply
- This means all forked themes with custom templates should check their files and rename privileges as necessary
- A new ephemeral group "guests" has been added re: #1331
- If you already have a "guests" group, please delete it and re-create it under a different name.
Notifications.push
has a callback. It is now error-first.- If you have a plugin that listens for that callback, adjust accordingly. (I don't think there are any, but still...)
- The signatures for
Topics.getTopicWithPosts
,Topics.getTopicPosts
andPosts.getPostsByTid
have changed. See https://github.com/NodeBB/NodeBB/commit/7610c11cd1b9de53ce185227ab80f86d55d3bd69 for details. - The hook filter:user.custom_fields has changed, it accepts an array of fields now.
This list will be updated as new breaking changes are added.
- The privileges system got a bit of a rewrite (+ UI revamp!), and almost all privileges have been renamed (issue #933):
-
No gotchas for 0.4.3?
-
I suppose this is still planned for 0.5.0? https://github.com/designcreateplay/NodeBB/issues/1437
-
Was gamification stuff going to show up soon? Or is that already capable through hooks and we are just waiting on a mod for that?
-
Or is that already capable through hooks and we are just waiting on a mod for that?
Pretty much, yeah. I have two in the works atm, ADR and Badges (badges being higher priority atm), not sure if anybody else has any they're working on
-
@planner don't see anything wrong with the update times, but there was a problem with the permissions which was letting you see topics from a hidden category, clicking on them would go to 404. Fixed that and updated.
What's wrong with the update times?
-
Related issue: https://github.com/NodeBB/NodeBB/issues/1978
This is another breaking change. It effects anyone using the hook
filter:user.custom_fields
andfilter:register.build
to add custom data to users on registration.If you were using
filter:user.custom_fields
to add new entries into the user object you can just switch the hook you are using tofilter:user.create
. No need to change anything else.If you are using
filter:register.build
to add new entries into the registration form and want these entries to get added into the user object you need to use the hookfilter:user.custom_fields
. In your plugin that adds new entries into the registration form just add a listener forfilter:user.custom_fields
and add the fields that you added to the form into the array passed in, here is a sample.// plugin.json { ... "hooks": [ { "hook": "filter:user.custom_fields", "method": "addCustomFields"} ], ... }
//plugin code function addCustomFields(fields, callback) { fields.push('newCustomField1'); // must match the input name you added to regForm fields.push('otherCustomField1'); callback(null, fields); }
After this when a new user registers they will have
newCustomField1
andotherCustomField1
entries in their user object.@bentael nothing needs to be done for spam-be-gone since we don't want the captcha form entries in the database anyways.
Before this change it was possible to add any field into the registration form client side and it was inserted into the database. Now only the fields that core and plugins specify are inserted.