Hey,
They just released an alpha version of shoutbox for d7 http://drupal.org/project/shoutbox, I just finished testing it and it's working great. I would like to try and make this work with Heartbeat. I know the D6 version has shoutbox integrated already. Can you take a look at the alpha version for D7? Any ideas on time-frame for this feature or what I could do to help would be AWESOME, great job on the module BTW I'm using it on multiple production sites.
- Edit -
Shoutbox integration is very basic at this point. To have it working, you could try the patches at #1267942: Shoutbox D7 Rules Integration and that should work with heartbeat.
I won't do any further integration as long as the functionality to poll activity (to make the shout appear in the stream immediately) is not incorporated into shoutbox.
I would also strongly suggest to give the heartbeat plugin "ActivityStatus" a chance. This works by default.
Comments
Comment #1
Sol Roth CreditAttribution: Sol Roth commentedI think this can be done completely with rules, without any additions to Heartbeat, BUT shoutbox alpha is missing rules integration - http://drupal.org/node/1078466#comment-4867588
Comment #2
Sylense CreditAttribution: Sylense commented+1. I created a new issue on the D7 alpha release of Shoutbox http://drupal.org/node/1267942
Shoutbox integration into the D7 release of Heartbeat would be NICE! A must have.
Comment #3
Stalski CreditAttribution: Stalski commentedWe should create a module or preferably a plugin (hook into streams) to get integration for shoutbox.
If someone is up for it, go ahead. I am willing to try this ofcourse but I can't be sure when I have time. I can say this gets priority of all feature requests for D7 version.
Comment #4
Stalski CreditAttribution: Stalski commentedcross-referencing #1267942: Shoutbox D7 Rules Integration
Comment #5
Stalski CreditAttribution: Stalski commentedFinished the work on this.
What has been done?
What can you do
Test this out with the patch in cross linked issue. And hope that my patch will be accepted and committed soon :)
Comment #6
Stalski CreditAttribution: Stalski commentedSorry
Comment #7
Stalski CreditAttribution: Stalski commentedEdit: Wrong issue comment
Comment #8
Sylense CreditAttribution: Sylense commentedI have updated to the latest dev of Heartbeat and applied the patch to Shoutbox but I am unable to get the shouts to display in the streams. I don't know if I'm missing something in my configuration or if something is wrong in the code.
I have:
- A custom heartbeat template "heartbeat_add_shout" with desc "user added shout"
- Content "!username !shoutbox_message"
- A custom rule "Log activity for a new shout"
- Event "After adding a shout"
- Action "Log activity for user added shout"
Parameter: Entity ID: [shout-message:shoutbox..., User ID: [user:uid], Entity target ID: 0, User target ID: 0, Message ID: user added a shout, !username: [user:name], !shoutbox_message: [shout-message:shoutbox...
I also have the shoutbox prepended to the streams. Am I doing something wrong?
Comment #9
sw3b CreditAttribution: sw3b commentedSubscribe
Comment #10
Stalski CreditAttribution: Stalski commentedStrange, works for me with this message:
and this rule
A couple of questions:
- is it inserted in the database table?
- is the rule triggered? (see debug mode in rules config)
- is it blocked from display by heartbeat? (see debug mode in heartbeat config)
- Can you give me your exports?
Comment #11
Stalski CreditAttribution: Stalski commentedI'd like to add that the shoutbox block itself is not used, since there is a stream of shouts above the shoutbox.
I added a heartbeat plugin "shoutbox" which can append that shoutbox above a heartbeat stream (per stream setting). This way, I can easily act on "shoutSubmit" to append it to the stream.
The logging itself is done as described above.
Comment #12
Sylense CreditAttribution: Sylense commentedStill can't get it to work. And I tried to import your heartbeat message template and I got a database error
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'obj' at row 1: INSERT INTO {ctools_object_cache} (sid, obj, name, data, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => EnSH7c8to2owvjs8ENgI0ycfVt6UbTbmwcJ4MXbufuI [:db_insert_placeholder_1] => ctui_heartbeat_templates.export_ui [:db_insert_placeholder_2] => ::import [:db_insert_placeholder_3] => O:24:"HeartbeatMessageTemplate":22:{s:3:"hid";i:0;s:10:"message_id";s:26:"heartbeat_shoutbox_message";s:5:"perms";i:4;s:11:"description";s:16:"shoutbox message";s:7:"message";s:50:"!message<br /> <small>posted by !username</small>";s:14:"message_concat";s:0:"";s:10:"group_type";s:6:"single";s:11:"concat_args";a:7:{s:8:"group_by";s:4:"none";s:12:"group_target";s:0:"";s:15:"group_by_target";s:0:"";s:13:"group_num_max";s:0:"";s:15:"merge_separator";s:0:"";s:19:"merge_end_separator";s:0:"";s:5:"roles";a:4:{i:1;i:0;i:2;i:0;i:4;i:0;i:3;i:0;}}s:9:"variables";a:2:{s:8:"!message";s:0:"";s:9:"!username";s:0:"";}s:11:"attachments";a:2:{s:16:"activitycomments";a:2:{s:7:"enabled";i:1;s:21:"activitycomments_node";i:0;}s:14:"flagattachment";a:2:{s:5:"flags";a:1:{s:4:"like";s:4:"like";}s:18:"flag_count_enabled";a:1:{s:5:"flags";i:1;}}}s:5:"roles";a:0:{}s:8:"new_type";N;s:4:"base";N;s:11:"api_version";i:1;s:8:"disabled";b:0;s:13:"export_module";s:0:"";s:11:"export_type";N;s:12:"in_code_only";b:0;s:5:"table";s:18:"heartbeat_messages";s:4:"type";s:5:"Local";s:25:"export_ui_allow_overwrite";i:0;s:14:"export_ui_code";s:1292:"$heartbeatmessagetemplate = new HeartbeatMessageTemplate; $heartbeatmessagetemplate->disabled = FALSE; /* Edit this to true to make a default heartbeatmessagetemplate disabled initially */ $heartbeatmessagetemplate->api_version = 1; $heartbeatmessagetemplate->message_id = 'heartbeat_shoutbox_message'; $heartbeatmessagetemplate->description = 'shoutbox message'; $heartbeatmessagetemplate->message = '!message<br /> <small>posted by !username</small>'; $heartbeatmessagetemplate->message_concat = ''; $heartbeatmessagetemplate->perms = 4; $heartbeatmessagetemplate->group_type = 'single'; $heartbeatmessagetemplate->concat_args = array( 'group_by' => 'none', 'group_target' => '', 'group_by_target' => '', 'group_num_max' => '', 'merge_separator' => '', 'merge_end_separator' => '', 'roles' => array( 1 => 0, 2 => 0, 4 => 0, 3 => 0, ), ); $heartbeatmessagetemplate->variables = array( '!message' => '', '!username' => '', ); $heartbeatmessagetemplate->attachments = array( 'activitycomments' => array( 'enabled' => 1, 'activitycomments_node' => 0, ), 'flagattachment' => array( 'flags' => array( 'like' => 'like', ), 'flag_count_enabled' => array( 'flags' => 1, ), ), );";} [:db_insert_placeholder_4] => 1315753059 ) in ctools_object_cache_set() (line 75 of /var/www/vhosts/kemosabi.com/httpdocs/sites/all/modules/ctools/includes/object-cache.inc).
Here are my current exports
Comment #13
Stalski CreditAttribution: Stalski commentedTry the import with shorter name 'ctui_heartbeat_templates.export_' is 32 chars ... so the ui cannot be inserted.
I can only say that it works here.
- apply the patch in shoutbox
- checkout this latest code from git
- go to plugins and see if the plugin is there
- edit the plugin and enable the "shoutbox" plugin
- go to the admin of the stream you want to prepend the shoutbox too
- enable the shoutbox setting for the stream
- visit the stream PAGE
There it works.
- As I said , give me examples of what's been done and what isn't. Rules module has a nice debug mode, heartbeat has too.
- check your database, permissions on the message, whatever ...
I can't say otherwise what could be wrong.
Comment #14
Sylense CreditAttribution: Sylense commented- I have applied the patch to shoutbox
- I have uninstalled and re-installed both Heartbeat and Shoutbox
- Plugin is shown
- Shoutbox enabled in plugin
- Prepended the shoutbox
- Created a heartbeat message template
- Created a log activity rule
- All of the heartbeat settings are set to display the messages - nothing is blocked from display
Still no dice. I have rules debugging on but no message appears so it appears the rule is never being triggered. The shoutbox is displayed above the stream but nothing ever logs into the stream. It just says "No activity yet"
Heartbeat 7.x-1.x-dev (2011-Sep-11)
shoutbox 7.x-1.0-alpha1 (patched)
rules 7.x-2.x-dev (2011-Sep-12)
Comment #15
Stalski CreditAttribution: Stalski commentedIf the rule is never triggered ... the problem is there, no?
So when you enter the rule in the rules UI, you do see the new event that I created for the shoutbox module?
And you don't see the rules debug mode tell you that some action was triggered and that it was successfull or not?
If you are a developer (dunno), you can start checking why the event is not triggered. The problem is very bizar.
That would be strange as it works great here. Hopefully somebody else can test this too.
Comment #16
Sylense CreditAttribution: Sylense commentedI'm not a developer but I may have someone take a look at it. The rules debugging isn't displaying on the stream pages for me to really tell. But for instance if I post a node and comment on it, I see the rules debugging information just fine - but only on the node. If I'm on the stream page no debugging info displays even if I comment. Could be because it is all submitted using ajax possibly, I'm not sure.
Comment #17
Sylense CreditAttribution: Sylense commentedFor testing purposes I added an action to the rule to send a system email when a shout is added and no email is ever sent. So my problem is definitely with the rules integration. The shouts are posting because if I look at the block generated by the standalone shout module they all appear - just not in the heartbeat stream. I don't know if that helps any. I will continue to try and fix the problem.
Comment #18
Sylense CreditAttribution: Sylense commentedOk I finally got it to work. Thanks for all the help! One question though, on your set up do the shouts ajax refresh the stream when you submit them? I have to refresh the page before I see the new shout. Other than that it works great.
Comment #19
Sol Roth CreditAttribution: Sol Roth commentedWhat did you do to get the rules integration to work? I did a quick test from this post and by default the rule is not triggering for me. I haven't been able to look deeply into it yet, but I will shortly and wondering if what you found could save me some time.
Comment #20
Stalski CreditAttribution: Stalski commentedSee http://drupal.org/files/issues/rules_integration_1267942_5.patch in #1267942: Shoutbox D7 Rules Integration. The event is defined there.
Comment #21
Sylense CreditAttribution: Sylense commentedI think my problem was because I only applied the 2nd patch. I thought the 2nd patch included the first but I had to run the 1st patch and then the 2nd and I finally got the Rule to trigger.
Comment #22
Stalski CreditAttribution: Stalski commentedSorry, indeed yes.
Comment #23
Sylense CreditAttribution: Sylense commentedDoes ajax submitting of shouts work? Ajax comments on the stream seem to be working for me but shouts only appear after a page refresh. Is this the expected behavior?
Comment #24
Sol Roth CreditAttribution: Sol Roth commentedI'm using the block in a Panel and it does show up without a refresh, but it takes 1 minute (time limit of long polling - I may change to 20 seconds). Everything is working very well, they've included the shoutbox rules integration into the dev release of shoutbox, so you no longer need to use the 2 patches above. To recap - Newest dev version of heartbeat and shoutbox working great for me and page does not need to refresh to post to stream.
Comment #25
Surabhi CreditAttribution: Surabhi commentedHi solomonrothman,
Can you please explain step by step how did you configured panels with shoutbox and hearbeat blocks.
I have configured heartbeats with shoutbox through rules. But the shout appears only after a page refresh.
We are a newbie to Panels & hence we find it difficult to configure shoutbox ,hearbeats & Panels. It would be a great help if you explain us steps for the above mentioned configuration
Comment #26
sw3b CreditAttribution: sw3b commentedI try with the export you did and it does not work. But when i do the process step by step, it work. I did a new hearthbeat message and a rule who triggers when you post a shout. After a refresh of the page the shout is in the stream.
So for me its working....
Comment #27
Stalski CreditAttribution: Stalski commentedA couple of answers first:
1) Does ajax submitting of shouts work?
It should work by default. The trick I would like to use is to call "pollForNewerMessages" on the event "AfterShoutWasSumitted". I need to look into Shoutbox module to see if it provides a hook, if not I might write one.
2) I read about the pollForNewerMessages setting and I must say with the solution above you could leave your polling timespan to 1 minute. It should not be less because of that shout-was-submitted.
Another thing, Panels or not has nothing to do with it due to the reason explained above: if the setting for heartbeatPollForNewerMessages is enabled, you won't need to refresh but it aint going to be instantly. So we really need the JavaScript event to trigger that function manually (, implicating that you don't need to enable polling what so ever).
Comment #28
Stalski CreditAttribution: Stalski commentedSee #1267942: Shoutbox D7 Rules Integration for more information ([#comment-5295690])
Comment #29
burianek CreditAttribution: burianek commentedGot errror while submitting full 255long shout in UTF-8 (localization).... To fix error too long message edit shoutbox.module
Comment #30
Stalski CreditAttribution: Stalski commented@burianek: Could you please post this issue at the issue queue where it belongs. shoutbox.module is not incorporated in heartbeat
Comment #32
KorbenDallas CreditAttribution: KorbenDallas commentedComment #33
KorbenDallas CreditAttribution: KorbenDallas commentedComment #34
KorbenDallas CreditAttribution: KorbenDallas commentedforgot to reopen
Comment #35
KorbenDallas CreditAttribution: KorbenDallas commentedComment #36
Stalski CreditAttribution: Stalski commentedHi
I don't have much time lately to look at my modules. Last I checked it worked as soon as you enabled the shoutbox plugin above a stream.
I can only give you some tips.
Do you have a javascript error somewhere that stops the heartbeat polling.
Does the heartbeat polling configuration works?
Is the heartbeat js called after the shoutbox button was submitted. Maybe the shoutbox hook changed or something?
I'll try to have a look but there are issues that are far more important with all due respect.
Comment #37
KorbenDallas CreditAttribution: KorbenDallas commentedFor those trying to get the basic functionality working between Heartbeat and Shoutbox, here is how I did it:
Thank you for the reply, I really do like the module. Here are the answers to your questions:
Q: Do you have a javascript error somewhere that stops the heartbeat polling.
A: No javascript errors
Q: Does the heartbeat polling configuration works?
A: It doesn't work for me, no. I am configuring it by going to the Heartbeat edit stream page and selecting 10 seconds for polling.
Q: Is the heartbeat js called after the shoutbox button was submitted. Maybe the shoutbox hook changed or something?
A: I don't know the answer to this question. It doesn't appear the hook changed since you issued Shoutbox Patch 9. I have checked the "Prepend a shoutbox form to the stream" for the stream I am testing. Just something to note here, neither the Shoutbox javascript message display on a new shout, nor the Heartbeat javascript on a new shout have ever worked for me. I've looked at the code and tried to fix it, but honestly I don't know enough about javascript to make it work.
Thanks for any help
EDIT: After working on this for 6 hours today I've come to the conclusion the javascript polling and updating between Shoutbox and Heartbeat is broken. I don't have the ability to fix this. I will continue building my site assuming this will be fixed in the future. Again, thanks for providing this for us and thanks for any help you can offer. Hope you can look into this soon.
Comment #38
Stalski CreditAttribution: Stalski commentedWell, It looks like that module is a little late in committing changes.
I won't look further for this support anymore as there is such behavior within heartbeat now as well (activity status plugin and the message is a heartbeat template entity ... so could not get easier.)
I will postpone this untill the shoutbox module will commit that hook if that's alright.
- Edit - it still works for me with all the patching
Comment #39
KorbenDallas CreditAttribution: KorbenDallas commentedI am sending you an e-mail I found on your website, please be so kind to read it and reply.
Comment #40
Stalski CreditAttribution: Stalski commentedI did that but won't spend anymore time on this issue. I simply don't have the time to check such things, especially since it's not the recommended way (heartbeat activity status plugin does the same thing).
I am working on that to make it invoke the ajax polling as well.
Comment #41
KorbenDallas CreditAttribution: KorbenDallas commentedI got it, thank you for the e-mail. For those referencing this thread, you must use the development versions of the supporting modules that Heartbeat uses. Also, you must enable Nodejs and Heartbeat's Nodejs integration for polling and automatic stream updating to work.
Comment #42
fraweg CreditAttribution: fraweg commentedHello
I still have some problems. When I will import the rule I have this message:
ntegrity check for the imported configuratoin failed. Error message: Unknown action <em class="placeholder">heartbeat_activity_heartbeat_shoutbox_message</em>..
What I have done:
-Install 7.x-1.x-dev and 7.x-1.0-alpha2
-patch the shoutbox module with:
-I create the template in Heartbeat with this:
and had this error:
I change the value of "ctools_object_cache" in the database from varchar "32" to "255" and after that this work.
- Then I import the rule and have the error...
Can anyone help?
Thanks
Frank
Comment #43
Stalski CreditAttribution: Stalski commentedPlease read #38 and #40 again.
I am sorry for this as well.
Comment #44
fraweg CreditAttribution: fraweg commentedHello,
no problem... :-) I am convinced that you have a lot of thinks to work and this should not be the main problem for you. I had hoped that "KorbenDallas" ore another one had an idea for this..
Thanks a lot,
Frank
Comment #45
Stalski CreditAttribution: Stalski commentedNo problem ;)
Message for everybody reading this:
Comment #46
KorbenDallas CreditAttribution: KorbenDallas commentedHi Frank, I can't be sure if this is your problem, but since you're getting cTools errors it might be rooted in cTools. For me, I had to do a new install of Drupal, install cTools dev version and dev versions from the supporting Heartbeat modules, and many problems went away after that. The reason, I am speculating, is cTools doesn't correctly utilize Drupal's update.php. (This means that you can't just copy the new module files, run update.php, and have cTools upgraded properly.)
But as Stalski has stated, Heartbeat is moving toward its own activityStatus plugin. This plugin is very new so it does not do everything Shoutbox can do, such as integrate with User Relationships and Organic Groups, but it's the future of Heartbeat. There are trade-offs when using Heartbeat + Shoutbox, and trade-offs when using Heartbeat + its activityStatus plugin. But, Heartbeat is the best activity module out there right now for 7.x. It's up to the web developer to fill in the gaps, and try to help others in the Drupal community when they can.
Hope this helped
Comment #47
Stalski CreditAttribution: Stalski commentedAdding tag ActivityStatus
Comment #47.0
Stalski CreditAttribution: Stalski commentedUpdated issue summary.