I can't use forum shoutbox for last 2 days I suppose. It's very strange since everyone else seem to be using it perfectly fine.
I just started to debug in order to see the problem, I'm not very familiar with SMF functions or PHP to understand the problem, but here is what I found:
Upon typing something in the shoutbox and then pressing "Shout!" button, I get the error in the console
XML Parsing Error: junk after document element
Location: https://cit.gg/index.php?action=portal;sa=shoutbox;xml
Line Number 14, Column 2:
Uncaught TypeError: XMLDoc.getElementsByTagName is not a function
onShoutReceived portal.js:78
onreadystatechange script.js:23
First XML error includes this markup:
<div id="fatal_error">
<div class="cat_bar">
<h3 class="catbg">
An Error Has Occurred!
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="padding">Sorry, this shoutbox does not exist.</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div class="centertext"><a href="javascript:history.go(-1)">Back</a></div>
Last line of the div with "centertext" class seems to be out of the root element which is a reason of the XML Parsing Error, everything outside the div of id "fatal_error" is considered as a junk. But I guess that's another bug in aftermath of the failed request in submitting the shout.
The second error is caused by:
function onShoutReceived(XMLDoc)
{
var shouts = XMLDoc.getElementsByTagName('smf') [0].getElementsByTagName('shout');
var shoutbox_id,
updated,
// ... //
}
The XMLDoc variable should contain XML document, but instead it is "false" assuming that the parameter request fails with a non-200 HTTP status. I've also debugged a function which contains the callback:
function sp_submit_shout(shoutbox_id, sSessionVar, sSessionId)
{
// can't paste the whole code because of the cloudfare, but this is the line of the callback //
sendXMLDocument(smf_prepareScriptUrl(sp_script_url) + 'action=portal;sa=shoutbox;xml', 'shoutbox_id=' + shoutbox_id + '&shout=' +
shout_body + '&' + sSessionVar + '=' + sSessionId, onShoutReceived)
}
Everything seems alright on paper, variables are defined, also manually tried to execute above function in console and it returns true(HTTP request status 200), but then I assumed that the XML document itself is wrong(first error), thus the callback function "onShoutReceived" is failing to parse the non-existent XML document.
I'm facing this problem on all the devices/browsers, it must be something related to my account(since everyone seem to be using shoutbox finely) and I can not understand how and why..