Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve adding new fields to user objects on topic view #7620

barisusakli opened this issue May 20, 2019 · 0 comments


None yet
2 participants
Copy link

commented May 20, 2019

Right now each post in a topic has a user object that contains these hard-coded fields.

If you want to add a custom field to the topic.tpl you have to do something like below

myPlugin.filterTopicBuild = function (hookData, callback) {
  const uids = => p.uid);
  user.getUsersFields(uids, ['valueId'], function (err, valueData) {
    if (err) { return callback(err); }
    hookData.templateData.posts.forEach(function (p, index) {
       if (p) {
           p.valueId = valueData[index];
    callback(null, hookData);

Would be nice if we could modify the hardcoded fields from a plugin so all you need to do is

myPlugin.filterUserInfoFields = function(hookData, callback) {
    callback(null, hookData);

@barisusakli barisusakli self-assigned this May 20, 2019

@barisusakli barisusakli added this to the 1.12.3 milestone May 22, 2019

@julianlam julianlam modified the milestones: 1.12.3, 1.13.0 Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.