This plugin isn't working anymore on my forum since a couple of months.
I'm on version 8.0.0 of the plugin, Nodebb version 1.19.1
The problem is that the spoilered text isn't loading when pressing on the spoiler header.
When turning on the JavaScript debugger, I get an
Error has occurred, error: [[error:no-privileges]]
in spoiler.js:50
.
The relevant JavaScript function that triggers the error is this one:
function toggle($button) {
var $spoiler = $button.parents(elements.MAIN),
$content = $spoiler.find(elements.CONTENT),
open = $spoiler.attr('data-open') === 'true',
postId = parseInt($spoiler.attr('data-pid')),
index = parseInt($spoiler.attr('data-index')),
icon = $button.find('i');
$spoiler.attr('data-open', !open);
if (!open) {
icon.removeClass(classes.OPEN_EYE).addClass(classes.CLOSE_EYE);
} else {
icon.removeClass(classes.CLOSE_EYE).addClass(classes.OPEN_EYE);
}
// Check if content is empty
if ($content.html().length === 0) {
socket.emit(
'plugins.ns-spoiler.getSpoilerContent',
{index: index, postId: postId},
function (error, content) {
if (error) {
return console.error('Error has occurred, error: %s', error.message);
}
$content.html(content);
}
);
}
}
The socket.emit
call always yields the "no privilege" error.
Any ideas?