Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To begin with, it's not used in core. It's not feasible to implement it for any key-value store (memcache. apc, whatnot). So... why it is there?
Comment | File | Size | Author |
---|---|---|---|
no_session_count.patch | 4.59 KB | chx | |
Comments
Comment #1
brianV CreditAttribution: brianV commented+1 for getting rid of this.
If someone really needs it, it can easily be added in via a contrib module, or a few lines of code in a custom block.
Comment #2
Dries CreditAttribution: Dries commentedI'm OK with removing this functionality. Will commit unless someone objects.
Comment #3
sunerrrrr. admin_menu uses this function, and it really helped that we improved it for D7.
Comment #4
chx CreditAttribution: chx commentedThere is a small problem: the function is unusable. In D6 there were some optimizations to not start a session for first visitors (aka googlebot) but in D7 the optimization is much heavier: unless you need a session you wont get one. So the function is totally and absolutely useless to count your anon visitors because (unless you destroy the performance increase) it will typically be 0. If you pick (and you should) another way to do stats, well it's easier to make that discern between anon and auth visitors.
Comment #5
sunIt seems I have to copy + paste.
Comment #6
sunCopy + paste the current code from D7 into admin_menu to at least count auth users, I meant.
Comment #7
catchhttp://api.drupal.org/api/function/user_block_view/7 is already using its own custom query for this. Completely unrelated side note, I'd like to see there issue where s.timestamp vs user.access was considered faster, seems like we could save a DISTINCT there.
Comment #8
Dries CreditAttribution: Dries commentedSo, we OK with removing this then?
Comment #9
sunYes it seems so. chx told me that there's almost nothing to count for anonymous users in D7, which was done elsewhere. While that is probably cool for performance, it's not really cool for modules that want to do something with anonymous visitors. Most likely, we need a dedicated contrib module to bring back some kind of new stats.
Comment #10
Dries CreditAttribution: Dries commentedAlright, committed to CVS HEAD. Thanks!