doesn't respect channel settings per node

igorik - January 23, 2009 - 17:03
Project:phpfreechat
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi

When I set name of channel in node edit, (content type settings per node with option to have own channel name) phpfreechat load but without channel
It show error: missing parameter /join channelname
when I set default channel in phpfreechat settings (admin/settings/phpfreechat), everything works fine.

thanks
Igorik

#1

permutations - January 23, 2009 - 17:37

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

#2

gumdrop - January 25, 2009 - 16:43

I am getting the same issues as well.

#3

browlands - January 29, 2009 - 16:34

Ditto, same issue, subscribing

#4

2006drupal - February 3, 2009 - 07:55

Me too.

#5

sebzur - March 14, 2009 - 18:13

And me. No channel at node page.

#6

anstosser - April 7, 2009 - 10:35

I have/had the same issue. But only if I close the channel manually. At the initial installation the channel were displayed well.

#7

cronix - June 6, 2009 - 20:38

Subscribing. Has anyone found a solution?

#8

cronix - June 8, 2009 - 20:53

I 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

  $args = explode('/', drupal_get_normal_path($path));
  $node = db_fetch_object(db_query('SELECT * FROM {node} n INNER JOIN {phpfreechat} pfc ON pfc.nid = n.nid WHERE n.nid = %d', $args[1]));

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.

#9

cronix - June 10, 2009 - 08:39

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

#10

fox mulder - June 23, 2009 - 00:13

Hi 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:

Leaving this (Default Channels field) blank will auto-generate a string based on the title parameter

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!

#11

cronix - June 24, 2009 - 08:37

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

#12

fox mulder - June 25, 2009 - 15:39

Hi 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?

 
 

Drupal is a registered trademark of Dries Buytaert.