Closed (won't fix)
Project:
phpFreeChat integration
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2009 at 17:03 UTC
Updated:
10 Apr 2015 at 04:21 UTC
Jump to comment: Most recent
Comments
Comment #1
permutations commentedI'll take a look at this.
So you saw my note about how to fix the "Anonymous" problem? If that solved the problem for you, I'd like to close the issue so please post a note there.
Comment #2
gumdrop commentedI am getting the same issues as well.
Comment #3
browlands commentedDitto, same issue, subscribing
Comment #4
2006drupal commentedMe too.
Comment #5
sebzur commentedAnd me. No channel at node page.
Comment #6
kasalla commentedI have/had the same issue. But only if I close the channel manually. At the initial installation the channel were displayed well.
Comment #7
cronix commentedSubscribing. Has anyone found a solution?
Comment #8
cronix commentedI have found the error, but I am not able to solve it. Who can help me out with this?
handler.php containts the following around line77
I am using pathauto and clean URL's. The code above is expecting that $args[1] contains the node id. But in my installation it holds the string "content" because the URL to my chatroom is: en/content/general-chat. For some reason drupal_get_normal_path is not returning the correct internal path representation.
Who can help with this code? We only need to figure out how to get the proper node id and this issue is solved.
Comment #9
cronix commentedAnyone active in this thread? The errors is due to the fact that I use a language prefex in the URL since my site is running multiple languages. The call to drupal_get_normal_path should be (for my example en/content/general-chat URL):
drupal_get_normal_path('content/general', 'en');and not (which is what currently is happening in the code)
drupal_get_normal_path('en/content/general'This is very fixeable, but I am unable to retrieve the value of $language in order to get the current users' language. I don't understand why this global is not set in handler.php.
Comment #10
fox mulder commentedHi everybody!
I have got same problem (phpfreechat ignores "pernode" settings).
Some remarks:
If I set to true the debug option on admin/settings/phpfreechat and type some channel name on edit form of the node, than the typed name appears in channels array in Parameters, but the pfcuserconfig_123456789xyz_channels array in Session is empty. Adding a default channel solves the "missing parameter (/join {})" problem, but admin/settings/phpfreechat says:
If I leave the Default Channels blank, the title of the node appears in channels array in Parameters truly, but not in pfcuserconfig_123456789xyz_channels array in Session.
I think, the problem is not in the Drupal module (I printed out the $params array from phpFreeChat() function of phpFreeChat class (modules/phpfreechat/phpfreechat/src/phpfreechat.class.php), and it contains the correct channels value) but in the phpfreechat itself.
Versions: D 6.12, phpfreechat 1.2, phpfreechat module 6.x-1.1.
Any ideas? Many thanks for the module and sorry about my bad english!
Comment #11
cronix commentedIt is in the module like I stated in #9. I have hardcoded a fix for myself that includes the language in the drupal_get_normal_path call and all is working.
Are you using language prefixes as well? Then my fix will probably work for you too.
Comment #12
fox mulder commentedHi cronix!
Thank you for your help.
I use only hungarian language, and a drupal_set_message() shows that the module finds the current node correctly. I tried a standalone phpfreechat on localhost, and it worked well.
If I understand your hack correctly, it is inside a(n)
if (!function_exist('arg')) {...}statement isn't it? Because arg() function exists (because it is part of Drupal), the modified (and the unmodified too) drupal_get_normal_path() doesn't ever run. How does your hack work?PS.: I don't know exactly how, but URL aliases cause the ignored "pernode" settings and empty "latest form.." block problems. If a node hasn't got a URL alias or a node has an alias but I use node/nn syntax in location bar of the browser than phpfreechat works correctly.
Any ideas?
Comment #13
wilton.pinheiro commentedSame issue here.....
Comment #14
typehost commentedI can confirm "fox mulder's" description - i.e. when I changed the name of the node to "node/nn" the per-node defined chat channels did appear correctly in the ppfreechat display for the first time rather than the globals. However, it still does not work when the page is called in a block through a view in a panel page. So maybe the problem is the use of the http extractor to get the node id in handler.php?
I would like to find a way to correct this so the channels work correctly in retrieving the nid even in blocks and panels. Thanks.
reference - handler.php (lines 71-81):
Comment #15
jewseppi commentedOkay I've got a solution/hack that I can GUARANTEE will work.
The problem is in 'join.class.php' in /phpfreechat/src/commands. I followed the params are far as I could and it looks like they are not being properly passed to the run function in the join.class.php file. It seems that when the run function is constructed the params variable is not yet populated, I tried creating session variables to hold the channel params but again, they were populating after the code in the join.class.php file.
The workaround requires you to set your channel in the join.class.php file. My channels are named based on the node title, but since phpFreeChat is managed by 'handler.php', $_SERVER variables regarding the path refer to the handler, some minor adjustments and we have the path in the address bar and not the path of the handler.php. From the path name, I can locate the nid in the url_alias table, and then extract the node title from the respective nid in the node table.
Works every time! ...
comment out line 20: //$channame = trim($param);
replace with the following:
// extract url alias and nid
$title = explode("/", $_SERVER['HTTP_REFERER']);
$query = db_query("SELECT src FROM `url_alias` WHERE dst = '%s'", $title[3]."/".$title[4]);
$result = db_fetch_object($query)->src;
// extract group title (channel name)
$query = db_query("SELECT title FROM `node` WHERE nid = '%s'", substr($result, strpos($result, "/") + 1));
$result = db_fetch_object($query)->title;
$channame = "Chat on ".$result;
Comment #16
permutations commentedThe problem with that solution, from a module perspective, is it's a fix to phpFreeChat itself, not to the module. So maybe this isn't something the module can control.
Comment #17
permutations commented