Hi, I have package/plugin in nbbpm
nodebb-plugin-change-reputation-testhow to remove it?
(I already removed it from npm)
Thanks
Thanks @administrators for the removed 👍
My plugin uses filter:widget.render hook, and recently when I upgrade my forum, the warning shows I need to set hookData.html. Is there any documentation about this? Thanks in advance.
Here is what you need to do in your plugin.
myPlugin.renderWidget = function (data, callback) {
//render html
var html = render();
data.html = html;
callback(null, data);
};
That will get rid of the warning.
@baris said in How could I resolve plugin warning about setting "set hookData.html":
data.h
Clould you explain what to change here and why @baris?
exports.filter_widget_render_minecraft_stats = function(widget, callback)
{
var current_time = (new Date()).getTime();
nodebb.app.render('widgets/minecraft_stats', { html: '<div id="tablediv"></div>', time: current_time }, function(err, html)
{
callback(null, html);
});
};
I also have this in the log:
9/12 15:11:34 [453] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin nodebb-widget-minecraft-essentials
. Skipping.
But i have a plugin.json
That warning occurs when the plugin isn't in node_modules. If you linked the plugin in, you might try npm link nodebb-plugin-minecraft-essentials
again
@jenkler said in How could I resolve plugin warning about setting "set hookData.html":
exports.filter_widget_render_minecraft_stats = function(widget, callback)
{
var current_time = (new Date()).getTime();nodebb.app.render('widgets/minecraft_stats', { html: '<div id="tablediv"></div>', time: current_time }, function(err, html) { callback(null, html); });
};
To fix this just change it to
exports.filter_widget_render_minecraft_stats = function(widget, callback)
{
var current_time = (new Date()).getTime();
nodebb.app.render('widgets/minecraft_stats', { html: '<div id="tablediv"></div>', time: current_time }, function(err, html)
{
widget.html = html;
callback(err, widget);
});
};
@baris said in How could I resolve plugin warning about setting "set hookData.html":
widget.html = html;
Thanks, seams to work