Closed (fixed)
Project:
Chatblock
Version:
5.x-1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Feb 2007 at 02:29 UTC
Updated:
23 Apr 2007 at 23:14 UTC
Getting the following error back from the Chat Log while looking at it with User 1.
warning: Invalid argument supplied for foreach() in /home/modules/chatblock/chatblock.module on line 440.
Can see the log alright with other authenticated users, but...
The other issue I am having is that "null" is displayed in the chat window, no matter what I type. And a new "null" is added roughly every 5 sec or so.
Running Drupal 5.1 with MySQL - 5.0.24a and PHP 5.1.2
Have the i18n module running.
Comments
Comment #1
dwees commentedIs it possible for me to view your chatblock in action so I can see if I can view the Javascript error that is giving you a problem? Which browser are you using to use it with? It is restricted to browsers that work with jQuery.
Dave
Comment #2
synesthete commentedMy installation is at http://difuzyon.artificialeyes.tv/
Mainly I am looking at the site with Firefox 2.0.0.1 on OS X. Also having trouble with Safari 2.0.4 and Firefox 2.0.0.1 under Win XP. I am able to get Chatblock to function properly with IE 6. So I am sorry to have seemingly wasted our time with this. I am very excited about Chatblock, it is the most useful chat solution I have seen to date in Drupal. I would very much like to be able to use it. Firefox and Safari support on the Mac are a must for me. Is there anything I can do to make this possible? Thank you for your time and consideration.
Comment #3
dwees commentedIt looks to me like the jQuery way of getting an element that has both an ID and a name set doesn't work properly. Not sure if this is a problem in general, or just a problem with jQuery. I'll try using the forms array method next, and see if this makes a difference.
I've also noticed that one of the sites I looked at that was having a problem was using a slightly different version of jQuery, not sure if that could be the problem. Maybe there was a bug-fix?
Dave
Comment #4
dwees commentedHopefully I've fixed this error. Wait a few hours for the CVS to be turned into an update and re-download chatblock. Then just copy over the version you have in your modules directory (just the chatblock.module file has been changed).
Alternatively, you can just examine the code below and make the changes in the module. It is pretty straight forward, I've left the lines that have been changed commented out of the script.
Comment #5
synesthete commentedThank you so much for the fast responses. Things are now good in Mac and Windows Firefox. Safari is still having trouble as well the newest version of Opera on Mac and Windows.
Comment #6
dwees commentedVery strange problem I noticed. If I view source with Opera, the name of the text input is 'edit-chatblock_text' on my screen and 'edit-chatblock-text' on yours. I'm going to rename this input in the module (everywhere) to chatblocktext and we'll see if removing the underscore does the trick. I'll do the same for the submit button (this means you will need to change it in the form definition too).
I'll post the code in a second.
Dave
Comment #7
dwees commentedQuick file post below for copy and paste into chatblock.module, will update CVS next (which will take 6-12 hours to show up).
Comment #8
synesthete commentedUpdated the module.Some new strange behaviors with Firefox and Opera on both Mac and PC. After typing and sending a message the send button greys out and I can no longer send messages without manually refreshing the whole page. Safari is working, but displaying "null" in the chat window after the entry is posted. IE 6 still fine.
Comment #9
ben soo commentedi'm seeing the same behavior.
Comment #10
dwees commentedOkay, well I'll try accessing the two elements in question using the forms array. However, I'm consistently not seeing the same behaviour on my website. Strangely enough, yesterday I looked at someone else's site and it had the exact same code as my site, and I looked at both sites with different tabs in the same browser, and his site did not work, and mine did. This leads me to believe that it might be an incompatibility with the theme of the website.
Anyway here is attempt number 3, just change the function in question.
Comment #11
dwees commentedAnother thing to try, assuming you've made the previous change is this:
Comment #12
dwees commentedSlightly 'improved' version out. Wait 12 hours or so and download it.
Thanks btw to all the people who are doing so much testing, it's much appreciated.
Dave
Comment #13
ben soo commentedIs because we think it a good idea!
Comment #14
synesthete commentedThis last patch seems to have been a bit of a step backwards for me. Can no longer post to Chatblock in Safari or Opera on the Mac, nor Opera on the PC. Thank you, Dwees for actively working on this very promising module.
Comment #15
synesthete commentedThe code in comment #11 that is. Will have to wait patiently for the CVS to update try out the latest version.
Comment #16
dwees commentedHopefully these JavaScript errors have been fixed by removing the - or _ from the form element ids. Seems to work in Firefox 2.0.x
Dave