Hey, I'm using this module primarily for aggregating the comments, facebook_status (module) updates, and nodes in a single feed (as I'm sure many other activity module admins are). In activity 1.x only published nodes showed up in the aggregated feeds. But using 2.x with views I'm completely dumbfounded (and I am dumb) as to what to use to ensure only published nodes are displayed. I tried using the typical "Node: Published" but this simply removes anything that is not a node from being displayed. What am I overlooking?

Thanks so much.

CommentFileSizeAuthor
#2 friend_activity_with_nodepublish.txt7.33 KBpribeh

Comments

Scott Reynolds’s picture

Status: Active » Postponed (maintainer needs more info)

Please export your View and attach it.

I tried using the typical "Node: Published" but this simply removes anything that is not a node from being displayed. What am I overlooking?

Sounds like if you edit the Node relationship and uncheck 'required' will get you here.

pribeh’s picture

StatusFileSize
new7.33 KB

Very sorry for not having attached the view in the first place. Oh, and I do have node relationship's "required" unchecked.

Scott Reynolds’s picture

Title: Filter for Published Nodes Removes Facebook Statuses » Add in publish/unpublish support per activity
Category: support » feature
Status: Postponed (maintainer needs more info) » Active

So the reason why this happens is really simple. By applying that filter, essentially becomes 'required'. Its the way SQL works.

But this feature is something I would like to add, the ability to unpublish an activity.

So heres the purposed solution
1.) add a column to activity table 'published'
2.) any time a node is unpublished, all activities matching that node are unpublished
3.) any time a user is blocked, all their activities are unpublished
4.) provide a handler for published/unpublished

and of course, when a node/user becomes published/unblocked then we publish those activities

Then as a followup, provide a method to publish/unpublish activity just like we do for the delete handler

pribeh’s picture

That would be fabulous, stellar and stupendous all at once.

pribeh’s picture

Oh, one concern. Is it possible to sync the activity creation time with that of the published time (with a module such as http://drupalmodules.com/module/published-time)? For a couple sites I'm planning on using Activity with I use a combination of the Save & Edit and Published_Time module to allow users to save their node before publishing. But activity doesn't sync with any sort of published time (obviously since there is no default Drupal feature of this sort).

Scott Reynolds’s picture

If I understand what you want, for node activities, you would only want to show the activity if the node is published. That is trivial, just add the Node relationship and then add the filter Node: Published.

As far as manipulating the time the activity is created, I don't see how Activity could do that, and it would be a separate issue.

pribeh’s picture

Ya, the original issue here is addressed by your response in #3. I've probably just made an additional request which I guess can't be supported so I won't bother making another thread for it. But the separate request is to provide a way of sorting an activity view with the published time set in an additional field that the module published_time provides. I can't even see how this would work considering the view in question would have to involve FBSS'. Perhaps I'll switch to the revision module. Sorry just thinking out-loud.

Scott Reynolds’s picture

Status: Active » Fixed

phew! ok this is now committed: http://drupal.org/cvs?commit=394534

It does not retroactivity set unpublished for currently block users, unpublished nodes or unpublished comments.

For block users, you will have to go and edit the user and click Save and that should fix block user activities.

For unpublished node, edit the node and click save.

For unpublished comment, use the admin interface for comments and publish it and then unpublish it again.

pribeh’s picture

Cool. This is amazing stuff Scott!

Status: Fixed » Closed (fixed)

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

littlealy’s picture

Confused newbie, here.

This thread seems relevant to my issue.

I can figure out how to keep something from showing up in the stream unpublished. That guy just didn't click off "required."

but then, ... how do I tweak the templates to get it to appear in the stream upon publish? The thing is, I need it to say, "new X has just been published!" And yet, not have updates saying that everytime someone edits a content?

See, I'm using content scheduler. The point of content scheduler for my site is so that I can, for example, have a blog entry publish every Tuesday at 9pm, without being at my computer Tuesday at 9pm, and yet it appears like fresh content is popping up on Tuesday in the activity stream. ... However, in this case, it shows up in the activity stream at creation time, not publish time, after it is finally published.

It seems this would be easier if Activity recorded on publish, not on create. But I'm guessing thats difficult or impossible to create....

Any ideas how I can hack this to work the way I want it to?

Scott Reynolds’s picture

Not sure how content scheduler works but assuming it uses the node publish unpublish flag it should be good.

You will need to use the Activity status filter in your View.

littlealy’s picture

Thanks for your quick response.

Sorry to be a pain, but that didn't even remotely solve my problem.... Let me try and explain myself further...

Yes, I am indeed using that filter. The problem is, again, that it is sorted by creation date, not by publish date:

Therefore, the content does not show up at all until it is published, at which point, it appears in the activity stream at the point of creation, i.e., weeks and weeks before hand. Which kind of defeats the point of the Activity module, as it then isn't letting anyone know when the content is going live.

Perhaps a better way to phrase this is:

How do I get Activity to record a message *at the time* that the content is published, instead of at the time that the content is *created*? Is there any way to do this?

Scott Reynolds’s picture

Try writing this in a custom module

function CUSTOM_MODULE_activity_record_alter(&$record, $context) {
  if ($context['hook'] == 'nodeapi' && $context['op'] == 'insert'] && $context['node']->type == SOME_TYPE_WITH_THINGS) {
    $record->created = some_function_that_returns_published_time($context['node'])
  }
}

This will catch each node creation and change its created time to the time in the future.