Hi,

I've noticed the Shout box in my website doing some funky behaviour, I'm not sure if its by design or not, but it's sort of annoying.

Basically, everytime I post a shout, the input button labeled "Shout" vanishes, you can still enter shouts as the text field is still visible, but you have to hit enter rather than click the input button.

Through firebug, I found that the input element was still there, but had an inline style applied to it as display: none;

Assuming that this inline style was applied via Javascript, I took a look at the shoutbox.js file and saw at the bottom this peice of code.

Line 189-  // Clear the form input 
Line 190-  $('#shoutbox-add-form').resetForm();
Line 191-  $('#shoutbox-throbber').show();
Line 192-  $('#shoutbox-add-form input#edit-submit').hide();
Line 193-  return true;	
};

Line 192 is what I beleive may be causing the problem?

Also,

Everytime I submit a shout, I receive a javascript error relating to the jQuery library that is visible through the firebug & mozilla console:

Error: object is undefined
Source File: https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js
Line: 605 ( length = object.length, )

Thanks for your help.

Comments

adamgerthel’s picture

I have the same problem using Alpha 2. Fresh install using Seven theme

micromu’s picture

I have the same problem. No solution ?

disterics’s picture

Assigned: Unassigned » disterics
borgewarvik’s picture

StatusFileSize
new1.13 KB

I've made a patch for this.

It fixes three problems.

  1. In JS, I've added a check to see if Drupal.shoutbox.afterPost has content, and if not do not iterate over it. This caused the jQuery error message.
  2. In shoutbox.module: The throbber form element is of type "item". The markup for this form element was set with "#value" which is wrong. The correct way is using "#markup" for markup. This has been fixed. The ajax throbber now shows correctly when pressing the submit button.
  3. The first fix made the button vissible again in Firefox and Opera on OS X. But not on Chrome and Safari on OS X. Fix number 2 fixed that.
plazik’s picture

I have the same problem.
#4 doesn't work for me because this patch have been already in the module.

I commented #192 line in shoutbox-form.js and it works for me fine but firebug console still have errors.

perohu’s picture

Is there a solution for this problem?

Commenting #192 line out is not the solution, because it breaks other funtionality (e.g. editing/unpublishing shouts and too long shout notification)

Thx

perohu’s picture

I realized that the problem is the patch mentionod at #4 post (it is already in 1.0alpha2)

It's very strange, that the desciption of the patch and what the patch is really doing is completly different.

If I roll back from the mentioned patch, there are no more javascipt errors and everyting is working fine, except one thing: Nothing happens, if the shout is longer then its maximum allowed lenght.

Bergzilla’s picture

Just installed shoutbox and had same problem, ofc i was lazy enough to look for a fix here, but seems I have to do everything myself ;)

So heres the fix, go to shoutbox-form.js and find line 192.

change

$('#shoutbox-add-form input#edit-submit').hide();

to

$('#shoutbox-add-form input#edit-submit').show();

And viola...

ichionid’s picture

StatusFileSize
new443 bytes

Patch for fix suggested from #8.

ichionid’s picture

Issue summary: View changes

removed the bold tags from code block, as they didn't bold the line obviously :P

vitalblue’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

Fixed in latest version