I'm running Drupal 5.7 with phpfreechat 1.1.
phpfreechat is supposed to save some crucial pieces of data in a MySQL table called phpfreechat. The INSERT code is called from within a nodeapi hook function. It's either never getting called or it's failing silently because nothing is being saved to the MySQL table. I've changed and saved the phpfreechat settings and there have been lots of chats on my site, but the table remains empty.
And, not surprisingly, the phpfreechat features that depend on the data in the table are failing:
- Default channels are ignored. When you try to set them you get an error that a parameter is missing.
- Default titles are ignored - you get the default phpfreechat title rather than what you specify or the title of the node, which is what's supposed to happen.
- phpfreechat blocks don't display properly because they depend on the node id (nid) from the database for identification, and the field does not exist.
I'm not familiar enough with Drupal modules in general or phpfreechat code in particular to take this any further, but I'm pretty sure I've identified the source of a range of problems that's reported in half a dozen different bug reports. Could someone take a look at this, please?
Comments
Comment #1
permutations commentedCould someone please answer?
Comment #2
permutations commentedI found where the data is stored. It's in the variables table. I don't know why it creates a table called phpfreechat and then doesn't use it.
Still, there are these two problems - default channels (though saved) aren't loaded), and block info isn't displayed (blocks are empty).
Comment #3
permutations commentedThe problem of blocks not displaying is posted in another bug report:
http://drupal.org/node/205091
So I'll restrict this one to the problem of default channels and titles being ignored. I don't know whether this is related to the phpfreechat table being empty because I haven't yet figured out what it's supposed to be used for - maybe it's just for the MySQL container?
I wish the module author would respond, and at least explain how things are supposed to work. That would help me find the bugs myself.
Comment #4
permutations commentedOkay - not all the information is stored in the variables table. The node info - the stuff that's supposed to be in the phpfreechat table - is not stored. This empty table is a bug.
I wish someone would either fix this, or describe a bit of the module structure so I can fix it. I'm a strong PHP programmer, but haven't written any Drupal modules. (I have written themes, and know the basics about hooking, etc.).
Comment #5
permutations commentedI found and fixed this bug. The function phpfreechat_nodedata in phpfreechat.module has a variable name specified incorrectly (two components are flipped). Change this:
to
Then, if you have enabled node-specific data, the phpfreechat table will be created.
The defaults still don't work, but the node-specific channels and title will load. I haven't found what causes the bug in ignored defaults.
Comment #6
permutations commentedI fixed the problem with the default channels. The code is here:
http://drupal.org/node/187468
Comment #7
permutations commentedI fixed all the bugs in the phpfreechat module (a few more than are listed above), updated the module version to 5.x-1.1, and posted the full package on my Web site.
I emailed the original author of the module about creating a new download, but he never answered me. There were too many changes to track of as individual patches.
Comment #8
owahab commentedThanks permutations for your effort.
Fixed.
Comment #9
permutations commentedThere's a new version with two additional fixes on my Web site (along with many other fixes).
Comment #10
permutations commentedComment #11
permutations commented