Author Topic: I can't use shout box on forum  (Read 1997 times)

Offline GoldNugget

  • Senior Community Member
  • ****
  • Posts: 527
  • Force is meaningless without skill
  • Registered: 04/12/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: xCode
  • Ingame: GoldNugget
I can't use shout box on forum
« on: 13 08, 2021, 07:47:12 pm »
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

Code: Text
  1. XML Parsing Error: junk after document element
  2. Location: https://cit.gg/index.php?action=portal;sa=shoutbox;xml
  3. Line Number 14, Column 2:

Code: Text
  1. Uncaught TypeError: XMLDoc.getElementsByTagName is not a function
  2.     onShoutReceived portal.js:78
  3.     onreadystatechange script.js:23
  4.  

First XML error includes this markup:

Code: XML
  1.         <div id="fatal_error">
  2.                 <div class="cat_bar">
  3.                         <h3 class="catbg">
  4.                                 An Error Has Occurred!
  5.                         </h3>
  6.                 </div>
  7.                 <div class="windowbg">
  8.                         <span class="topslice"><span></span></span>
  9.                         <div class="padding">Sorry, this shoutbox does not exist.</div>
  10.                         <span class="botslice"><span></span></span>
  11.                 </div>
  12.         </div>
  13.         <div class="centertext"><a href="javascript:history.go(-1)">Back</a></div>
  14.  

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:

Code: Javascript
  1. function onShoutReceived(XMLDoc)
  2. {
  3.   var shouts = XMLDoc.getElementsByTagName('smf') [0].getElementsByTagName('shout');
  4.   var shoutbox_id,
  5.   updated,
  6.   // ... //
  7. }
  8.  

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:

Code: Javascript
  1. function sp_submit_shout(shoutbox_id, sSessionVar, sSessionId)
  2. {
  3.  // can't paste the whole code because of the cloudfare, but this is the line of the callback //
  4.  sendXMLDocument(smf_prepareScriptUrl(sp_script_url) + 'action=portal;sa=shoutbox;xml', 'shoutbox_id=' + shoutbox_id + '&shout=' +
  5.  shout_body + '&' + sSessionVar + '=' + sSessionId, onShoutReceived)
  6. }
  7.  

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..

there are people who think and there are people who follow

Offline GoldNugget

  • Senior Community Member
  • ****
  • Posts: 527
  • Force is meaningless without skill
  • Registered: 04/12/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: xCode
  • Ingame: GoldNugget
Re: I can't use shout box on forum
« Reply #1 on: 13 08, 2021, 07:52:04 pm »
Warned forum users can't send messages in the shout box.

From when? I'm sure they could and even there was a rule for forum muted players not to use the shoutbox if they didn't want to get banned.

there are people who think and there are people who follow

Offline GoldNugget

  • Senior Community Member
  • ****
  • Posts: 527
  • Force is meaningless without skill
  • Registered: 04/12/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: xCode
  • Ingame: GoldNugget
Re: I can't use shout box on forum
« Reply #2 on: 13 08, 2021, 07:58:01 pm »
Well, that's so disappointing, I'm not even muted and can't use the shoutbox smh...

there are people who think and there are people who follow

Offline GoldNugget

  • Senior Community Member
  • ****
  • Posts: 527
  • Force is meaningless without skill
  • Registered: 04/12/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: xCode
  • Ingame: GoldNugget
Re: I can't use shout box on forum
« Reply #3 on: 14 08, 2021, 01:14:50 pm »
Well, I can't modify my recent post so I've to make a new one.

So, as I understand something was made to prevented warned users not to be able to use shoutbox. My question, is the XML URL link purposely wrong and it was the choice of solving a problem with a "very user friendly" approach, or it's a bug and should be fixed?

Code: Javascript
  1. function sp_submit_shout(shoutbox_id, sSessionVar, sSessionId)
  2. {
  3.  // can't paste the whole code because of the cloudfare, but this is the line of the callback //
  4.  sendXMLDocument(smf_prepareScriptUrl(sp_script_url) + 'action=portal;sa=shoutbox;xml', 'shoutbox_id=' + shoutbox_id + '&shout=' +
  5.  shout_body + '&' + sSessionVar + '=' + sSessionId, onShoutReceived)
  6. }
  7.  

This function returns XML URL of https://cit.gg/index.php?action=portal;sa=shoutbox;xml while the correct XML URL is https://cit.gg/index.php?action=portal;sa=shoutbox;shoutbox_id=1;xml

Is the function intentionally fucked up for the warned users?  :what:

there are people who think and there are people who follow

Offline Violet

  • State Official
  • ****
  • Posts: 2080
  • Registered: 05/02/2019
    YearsYearsYearsYearsYears
  • Group: Hymie
  • Ingame: Violet
Re: I can't use shout box on forum
« Reply #4 on: 17 08, 2021, 12:21:49 pm »
Mustn't be warned. @iFrank  this can be locked.

Offline iFrank

  • Bikers Vice President
  • Outstanding Community Member
  • *****
  • Posts: 1046
  • somebody that you used to know
  • Registered: 12/02/2012
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: I can't use shout box on forum
« Reply #5 on: 23 08, 2021, 09:01:09 pm »
Well, I can't modify my recent post so I've to make a new one.

So, as I understand something was made to prevented warned users not to be able to use shoutbox. My question, is the XML URL link purposely wrong and it was the choice of solving a problem with a "very user friendly" approach, or it's a bug and should be fixed?

Code: Javascript
  1. function sp_submit_shout(shoutbox_id, sSessionVar, sSessionId)
  2. {
  3.  // can't paste the whole code because of the cloudfare, but this is the line of the callback //
  4.  sendXMLDocument(smf_prepareScriptUrl(sp_script_url) + 'action=portal;sa=shoutbox;xml', 'shoutbox_id=' + shoutbox_id + '&shout=' +
  5.  shout_body + '&' + sSessionVar + '=' + sSessionId, onShoutReceived)
  6. }
  7.  

This function returns XML URL of https://cit.gg/index.php?action=portal;sa=shoutbox;xml while the correct XML URL is https://cit.gg/index.php?action=portal;sa=shoutbox;shoutbox_id=1;xml

Is the function intentionally fucked up for the warned users?  :what:

The only thing I know in regards to your inquiry is that the inability to use the forum shoutbox while having a warning is intended.

Locking this.

BIKERS M.C.