Slim Stat forcing page reload in bbPress when using dynamic reply forms
-
First of all, great work on Slim Stat. It’s a seriously impressive plugin.
I’ve encountered a compatibility issue between WP Slim Stat and bbPress dynamic reply forms.
The dynamic reply forms are an extension that uses AJAX to put a reply form directly below its parent comment without reloading the page.
Details:
https://bbpress.org/forums/topic/how-to-create-dynamic-reply-box/
https://bbpress.org/forums/topic/how-to-create-dynamic-reply-box/#post-178454With WP Slim Stat disabled, this bbPress extension works correctly. When WP Slim Stat is enabled:
1. Clicking ‘reply’ moves the reply form using AJAX as expected
2. The page reloads
3. The reply form is back to its original position.I recognize this is a compatibility issue, not an issue with WP Slim Stat per se. With that in mind, I’m not expecting the Slim Stat crew to spend their limited time looking for a fix. However, if you could provide a bit of insight on how Slim Stat works, it might give me a starting point to finding a solution.
Some questions to consider:
1. What would cause Slim Stat to reload a page?
2. Is there any way to disable Slim Stat when the current page is a bbPress page?Thanks a lot for your help. Your team is amazing!
For quick reference, this is the dynamic reply form code that WP Slim Stat is conflicting with:
addReply = { moveForm : function(replyId, parentId, respondId, postId) { var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id'); if ( ! reply || ! respond || ! cancel || ! parent ) { return; } t.respondId = respondId; postId = postId || false; if ( ! t.I('bbp-temp-form-div') ) { div = document.createElement('div'); div.id = 'bbp-temp-form-div-123'; div.style.display = 'none'; respond.parentNode.insertBefore(div, respond); } reply.appendChild(respond); //This is the critical line that has been patched according to https://bbpress.org/forums/topic/how-to-create-dynamic-reply-box/page/2/#post-178847 if ( post && postId ) { post.value = postId; } parent.value = parentId; cancel.style.display = ''; cancel.onclick = function() { var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId); if ( ! temp || ! respond ) { return; } t.I('bbp_reply_to').value = '0'; temp.parentNode.insertBefore(respond, temp); temp.parentNode.removeChild(temp); this.style.display = 'none'; this.onclick = null; return false; }; try { t.I('bbp_reply_content').focus(); } catch(e) {} return false; }, I : function(e) { return document.getElementById(e); } };
- The topic ‘Slim Stat forcing page reload in bbPress when using dynamic reply forms’ is closed to new replies.