Closed (won't fix)
Project:
Drupal Commons
Version:
6.x-2.x-dev
Component:
Activity/status streams
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2011 at 11:41 UTC
Updated:
4 Mar 2014 at 23:06 UTC
Jump to comment: Most recent
Comments
Comment #1
ezra-g commentedThanks for the report.
This is likely a result of how we do #1244930: The streams should enforce node access restrictions.
It would be great if you could file a bug in Activity log's queue and reference this issue.
Comment #2
icecreamyou commentedFor the reasons stated here, I'm pretty sure this is not fixable simply due to the approach taken to dealing with node access. Ezra, I assumed you knew that when you suggested this approach (and I mentioned it here). But if you know something I don't, like if it's possible to change the internal pager configuration after pager_query() is run (maybe by altering the globals
$pager_page_array, $pager_total, $pager_total_items?) I'd be happy to hear it.Comment #3
lightsurge commentedI was thinking it might be possible to exclude all fields from the View, put in a views custom field with php to check for node access and return an empty row unless the user has it.
Was this sort of method dropped because of having to run a mini-query per row?
Comment #4
ezra-g commentedYes, but given the release date target for Commons and the fact that Activity log didn't respect Drupal's node access system at all, there wasn't a better approach short of re-architecting the module per #1259306: Re-architect activity message visibility. I think an approach as you're suggesting like altering the $total_items or similar would be good, though ultimately it sounds like there are already several reasons to consider re-architecting message visibility in the long run.
Comment #5
lightsurge commentedIn case it helps anyone before this architecture review comes in, I hacked apart Ezra's code to come up with code for a views custom field (and I know, I'm using a method that's really not efficient in this scenario, but I'm no programmer so it was the best I could come up with, if anyone can neaten it up I'd appreciate it!). All you have to do is download views_custom_field module, exclude the message field from view, and add this in a custom field:
You'll also need to patch views_custom_field with the code here http://drupal.org/node/810190#comment-3109330 in order to enable rendering of tokens (The $data variable on each views row does include a message cache variable with a rendered view of the field which you could use instead and not bother patching customfield, but there are characters at the start and end you'd have to trim off.)
Comment #6
gregglesOne "solution" to this is to stop using pagers and start using something like the twitter and google plus streams: the infinite page that uses javascript to pull more data if the browser is at the bottom of the "page" and degrades to a "more" button for non-js users.
It would require a bit more work and javascript, but it solves this problem AND brings in ajax that people love.
Comment #7
lightsurge commentedThere's already an infinite pager module http://drupal.org/project/views_infinite_pager
I'm not totally sure how this would work though when some pages will appear empty, I'm presuming that it still does pagination, it's just that the pages are offered up differently?
Just discovered my method doesn't work... It does the same job in terms node access but still the problem with pagination... I was sure that Views was capable of omitting a rows from its pagination that are totally devoid of output... but seems I must be wrong.
Edit: Of course if I'd been less of a numpty and looked at this first I could've saved myself the effort http://api.drupal.org/api/drupal/includes--pager.inc/function/pager_query/6
Comment #8
icecreamyou commentedViews field handlers are run after the results are already retrieved, so that wouldn't be any better than what we're already doing.
Problem is, sites need footers. So the way Jay wanted to do infinite pagers was with a "Show more" button (for everyone, not just for non-JS users) which wouldn't help since you'd still end up with too few items before the button appeared.
Comment #9
gregglesSomeone should tell that to google plus and twitter. They will certainly implement it right away once they are alerted.
Comment #10
lightsurge commentedFor info, there is already a patch for the infinite pager module to automatically load the next page #968626: Automatically load next 'page' which I suppose could work quite well.
For me, the footer issue isn't a great one, but I can see how for others it would be. I suppose one possibility would be to have a 'floating' footer if you see what I mean, so that it's always at the bottom of the screen.
Is it not possible to have a Views relationship that links activity to nodes, so that the pagination could be dealt with in the query?
Comment #11
icecreamyou commentedI'm with you, but G+ and Twitter are not generic site-building tools. They're social extranets, and they have a very limited subset of Commons' functionality (and therefore different use cases).
That is what I meant when I said "The ideal approach is to filter out node messages in the query, but I believe that isn't feasible with the current architecture."
Comment #12
lightsurge commentedIt sounds like this re-architecture is something that will take awhile, but as activity logs have become the 'one stop shop' of Commons, this, along with #1256754: Node posted into 2 groups, activity stream only reports on first group and #1292122: Email digests not being sent means that the one stop shop is often making the shop look quiet when it might be thriving, and quiet is never a good thing at all for a web app of this sort, and so not good for Commons.
Using ajax in terms of #968626: Automatically load next 'page' and this issue seems like a good bet to me to compensate for an inadequate pager_query, until that can be rectified.
Comment #13
lightsurge commentedJust to let those interested know that http://drupal.org/project/views_infinite_pager works really well for filling up a page that's been split into a silly number of empty or partially filled pages.
You don't actually have to patch it, the functionality for autoload has already been committed.
Comment #14
japerryNo longer applicable in 7.x-3.x and we're no longer working on non-security bug fixes for commons 6.x-2.x