On initial install I got a drupal message saying it had failed( in the code it looks like that empty array will always evaluate to false). The tables installed and are correct.

The configuration page does not show up in admin/config/, had to read the .module to find the path.

After finding the page and seeing that I needed YUI, i downloaded extracted to my library and went back to config page....took a very very long time to load and gave the error below almost a hundred times:

Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in file_scan_directory() (line 1984 of /var/www/titan.jlporter.com/site/includes/file.inc).

On a side note I also noticed that there was no drupalchat block that the readme indicated there would be.

Comments

darklrd’s picture

Hey jlporter,

Thanks for critically analyzing and posting D7 errors. I am aware of these errors. Currently the 7.x-1.x-dev is unstable as I have not been able to port it completely. I am working on it and hope to complete it soon!

Yes that readme needs to be updated.

Thanks a lot!
darklrd

jyee’s picture

Subscribing.

There are other errors that i've encountered, but seeing as the D7 port work isn't done, it's probably not helpful to list them.

danielm’s picture

Subscribing

jlporter’s picture

I haven't tested out 6.x-2.x yet but it might make sense to fork 7.x from there(stuffs going to break, might as well go with current architecture). I'm pretty tied up until after the 1st of March. I'll be able to help port if you don't mind.

darklrd’s picture

Awesome! It ll be great if you can help port 6.x-2.x to 7.x :)

darklrd’s picture

Status: Active » Closed (duplicate)
darklrd’s picture

Status: Closed (duplicate) » Needs work

Sorry, posted in the wrong thread.

avo_liao’s picture

subscribe.
What a great module!

DonMiguel’s picture

Are you still working at the Problem? The new version of 25th Feburary isnt better. I cant find the Chatline in the Blocks. I hope you can fix it soon this module is very useful if it works.

darklrd’s picture

Yes, I am. But it will take time.

Thanks

hunziker’s picture

StatusFileSize
new3.89 KB

I have tested the module on drupal 7. I have fix some errors:

First: preg_match error

First the preg_match error can be fixed by changing the line 439 in drupalchat.module from :

<?php
$path = drupalchat_library_path('drupalchat_yui_path', '^yui-min\.js$', 'yui-min.js');

// to

$path = drupalchat_library_path('drupalchat_yui_path', '/^yui-min\.js$/', 'yui-min.js');
?>

This does solve the problem, but there is still an error. The path is no set automatically. So you need to setup the path by hand. The code is a bit wired here too many unnecessary calls etc. So probably someone cleans it up.

Disappeared Config Menu

Next problem with the disappeared config menu:
I mad the following changes:

On line 129 in drupalchat.module

<?php
// From:
 $items['admin/config/drupalchat'] = array(
    	'title' => 'DrupalChat',
    	'description' => 'Administer DrupalChat',	
    	'page callback' => 'drupal_get_form',
    	'page arguments' => array('drupalchat_settings_form'),
    	'access arguments' => array('administer drupalchat'),	
    	'file' => 'drupalchat.admin.inc',
    );


// TO:
  $items['admin/config/chat'] = array(
    'title' => 'Chat',
    'description' => 'Administer and configure chat',
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array('access administration pages'),
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );

  $items['admin/config/chat/settings'] = array(
    	'title' => 'Chat Settings',
    	'description' => 'Administer DrupalChat',	
    	'page callback' => 'drupal_get_form',
    	'page arguments' => array('drupalchat_settings_form'),
    	'access arguments' => array('administer drupalchat'),	
    	'file' => 'drupalchat.admin.inc',
  );

?>
Chat Footer Panel is not shown

In the footer the chat panel should be shown. The API has changed here. So we need to replace the function drupalchat_footer with this function:

<?php
function drupalchat_page_alter(&$page) {
  global $user;
  if (user_access('access drupalchat')) {
    $page['page_bottom']['drupalchat'] = array(
    	'#markup' => theme('drupalchat')
    ); 
  }
}
?>

This change leads to another error in the drupalchat_preprocess_drupalchat function.

Error in _drupalchat_buddylist_online()

Here is the invocation of the result set wrong. You must do it this way:

<?php
foreach($result as $buddy) {}

// and not

while($buddy = db_fetch_object($result)) {}

?>
Wrong invocation of theme('item_list'...)

You need to call the function different. See this code:

<?php
// in _drupalchat_chat() I correct it to:
theme('item_list', array(
      'items' => array(
        l(t('No users online'), 'user'),
       ),
       'type' => 'ul',
      )
    );
?>
Conclusion

With this changes some of the errors disappear, but when you try to use it, sometimes you get a blank page. (I think there is a problem with the theme function). Anyway I hope this helps to bring this project to Drupal 7. I have added my patch here. I use the latest downloadable dev version.

darklrd’s picture

Thanks a lot hunziker! I will test and commit it. Thanks again :)

priapurnama’s picture

Managed to get all errors gone thanks to these steps, hunziker. The configuration now shows, the chat bar is there - http://screencast.com/t/UjNuSShw5tF

Great! The only thing is it it keeps loading and it does not actually work. Can you give me a lead of which function I can look into?

Thanks!

hunziker’s picture

Hi priapurnama

Im not sure where the problem resists. Because I'm getting sometimes a white screen, I think the problem is in a theme function. But that is not that easy to debug, because you get no error message.

harryhirsch’s picture

Please post a new version of drupalchat, I need it urgently,

best regards

harryhirsch

priapurnama’s picture

Is there any way I can turn on error messages on this?

hunziker’s picture

I'm not so familiar with the Theme engine of Drupal 7. So i can not say if this is possible. It is also not sure that the problem comes form some theme issue. It can be also some other problems in the message exchange mechanism.

Renegadez’s picture

Sub

danielm’s picture

hello everybody,

When I use #11 patch I get the following error:

Notice: Undefined index: header in include() (line 15 of /var/www/public/sites/all/modules/drupalchat/drupalchat-subpanel.tpl.php).

Thanks

hunziker’s picture

Hi Daniel

I know that there must be an error in the code. My problem is that I don't see any error message. How do you activate error reporting?

Thank you for reply.

sergiofg’s picture

suscribing

haggster’s picture

subscribing

danielm’s picture

Hi hunziker

To see all messages must be modified php.ini in your webserver(Development Value):

error_reporting = E_ALL | E_STRICT

Regards
Daniel

monican’s picture

Subscribing

hunziker’s picture

I have resolve the problem with the error display. In Debian 6 and PHP 5.3 you need to activate the error display in the php.ini otherwise the error is only logged in the log file.

darklrd why you use the YUI library? What benefit brings it in, in comparison to jQuery? I think there resists some problems with the jQuery Version used in Drupal 7 and the YUI library.

hunziker’s picture

I have found out more about the problems:

In the file /js/drupalchat.js in line 46 there is the following code:

$('#drupalchat').html(Y.StorageLite.getItem('drupalchat'));

It seems that, this breaks the application. The chat footer is replaced by an empty string. I think something with the storage engine is wrong.

danielm’s picture

Any news on this call ?!?

hunziker’s picture

I have no news about this. As I discover some internals of the drupalchat module I see some additional problems. If you want to use this module on larger websites, the long polling (as also the short polling) mechanism is not efficient enough (Apache & PHP do not provide good polling mechanisms). So there is in any case a rewrite necessary to enable the use of node.js or some other high performance server for providing a push mechanism. This is really a needed feature, because without a good performance no one can use it in live environment.

sinav sonuclari’s picture

subscribe.

darklrd’s picture

I am planning to work on this as part of GSoC 2011 - http://groups.drupal.org/node/137754. You may want to rally your support there.

Thanks

Anonymous’s picture

Hi all

Doesn't work to me after patch, it stays refreshing but nothing hapens

Best regards
ArchGalileu

pekrr1e’s picture

You can fix it with the following change for the installation.
change the 439th line in drupalchat.module,
$path = drupalchat_library_path('drupalchat_yui_path', '^yui-min\.js$', 'yui-min.js');
to
$path = drupalchat_library_path('drupalchat_yui_path', '/^yui-min\.js$/', 'yui-min.js');

You can fix YUI script auto-search bug with the following change,
change the 140th line in drupalchat.admin.inc,
$files = drupal_system_listing($match, 'libraries', 'basename', 0);
to
$files = drupal_system_listing($match, 'libraries', 'filename', 0);

bryancasler’s picture

subscribe, +1 for updating the dev with these patches so it's at least usable.

nard0207’s picture

same as #13, errors were gone but still the chat box just keeps on loading.

also in the recent log messages this message appears ---> Theme key "drupalchat_notifications_contents" not found.

any idea how to make drupal chat work on drupal 7?

nard0207’s picture

StatusFileSize
new158.66 KB

In addition to that, in Reports->Field List i get these notices:
Notice: Undefined index: comment_node_chatroom in _field_ui_bundle_admin_path() (line 310 of /opt/bitnami/apps/drupal/htdocs/modules/field_ui/field_ui.module).
Notice: Undefined index: comment_node_chatroom in field_ui_fields_list() (line 25 of /opt/bitnami/apps/drupal/htdocs/modules/field_ui/field_ui.admin.inc).
Notice: Undefined index: comment_node_chat in _field_ui_bundle_admin_path() (line 310 of /opt/bitnami/apps/drupal/htdocs/modules/field_ui/field_ui.module).
Notice: Undefined index: comment_node_chat in field_ui_fields_list() (line 25 of /opt/bitnami/apps/drupal/htdocs/modules/field_ui/field_ui.admin.inc).

yugongtian’s picture

+1

urbanfarmer’s picture

subscribe

starmate’s picture

StatusFileSize
new200.56 KB

Hi there!
I've worked a bit on this module (drupal 7 version) to fix some issues.
Find attached the work I've done.

Regards,

Jon

nard0207’s picture

StatusFileSize
new107.52 KB

I have downloaded your module but it seems there were no improvements compared to the patched version of this module.

Here is the screenshot, it just keeps on loading.

starmate’s picture

Dear nard0207,

I don't have any issue regarding the version I sent to you.
Did you flush the drupal cache and your browser cache? It could help.

Best regards,

Jon

nard0207’s picture

I have flushed the drupal cache and my browser cache and still it doesn't work.
The chat box just keeps on loading. Could you upload a tar.gz version of that file?
Thanks.

Starminder’s picture

subscribe

harryhirsch’s picture

Does not work with firefox 4. Who knows why.

b.regards Harry

tjtj’s picture

Starmate's zip file worked for me. Many thanks. Why isn't this put out as a new release to save others days of frustration?

There is one issue though. It clicks occasionally when no one is on and I am not chatting. And I also get the same message from someone who has left. It reappears with a new time attached, even though I have read it.

Another issue. If I use Ajax instead of long polling, the messages repeat.

tomroelandt’s picture

@nard0207 HEROOOO!

andyjh122’s picture

hi starmate, your zip fixed all the errors, thanks for the great work!

but for some reason the long polling doesn't work, users don't show up and messages don't get transferred.

AJAX does work, but consumes too much CPU...

any thoughts?

thanks!
Andrew

darklrd’s picture

Is starmate's zip working? I don't have time to test it right now. If it is working properly lemme know, I will commit it then. Thanks for your contribution mate! :)

Cheers

darklrd

darklrd’s picture

Status: Needs work » Fixed

Thanks starmate! I have committed this code.

Cheers

darklrd

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.