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.
The attached patch makes it possible to sort by the number of user's who have signed up for a node. It requires a patch to views #143888: support subqueries.
Comment | File | Size | Author |
---|---|---|---|
#6 | signup_counts.tar_.gz | 1.53 KB | reubenavery |
views_signup_count.patch | 1.43 KB | douggreen |
Comments
Comment #1
dwwLooks great to me. Marking postponed until #143888 lands. Thanks! (FYI: see also #179585: Signup count field in Views 7.x)
Comment #2
altparty CreditAttribution: altparty commentedIs this 'feature' already part of 5.x-2.6 or can this patch be used against 5.x-2.6?
Or are other options available to count the number of signups to be used in Views (sort)?
Comment #3
dwwNo. If it was in 5.x-2.6, I would have marked it "fixed" and changed the version. As I already said, this is postponed, awaiting support from views.module for subqueries. Which part o comment #1 wasn't clear? ;)
Comment #4
altparty CreditAttribution: altparty commentedYour first post was certainly clear :-). Thanks.
I was just curious if there was any progress that might have slipped my attention.
I also tried to use the patch against 5.x-2.5, in which I didn't succeed...
Thanks for your quick response anyway.
Comment #5
reubenavery CreditAttribution: reubenavery commentedI'm not very enthusiastic about this approach. I'd prefer to go the direction that voting_api went, where there's a separate table that keeps a running count total by nid. The approach here with a query executed for each result row is a rather expensive db operation, I think.
I was going to modify the module and post a patch, but looking at how robust the hook system is, I think I'll just utilize that and DIY in a separate module. I will post code to that once I'm done, if anyone's interested :-)
Comment #6
reubenavery CreditAttribution: reubenavery commentedHi, here is a module I wrote which creates a "signup_counts" table, with a running count of enabled signups for a node, and a Views field/sort/filter definition.
Comment #7
MilOrg CreditAttribution: MilOrg commentedreubidium - that one did exactly what I was looking for.
Why not make it a project?
Good job :-)
Comment #8
MasterChief CreditAttribution: MasterChief commentedHi reubidium !
Your module seems to work well but i have a question.
Is it possible to add maybe another filter which tell if signups are empty or not, if 0 signup = Empty else if > 0 not Empty ?
Thank you for your work :)
Comment #9
alfiozzz CreditAttribution: alfiozzz commented@reubidium yeah that should definately be placed in a project, and I confirm this also works with Signup 6.x-1.0.
Thank you reubidium :)
Comment #10
reubenavery CreditAttribution: reubenavery commentedHi all, Bob Kepford set up my signup_counts module as a sandbox project here:
http://drupal.org/sandbox/kepford/1243502
Someday it should have its own module project page, I guess..
Comment #11
kepford CreditAttribution: kepford commentedreubidium's module Signup Counts now has a permanent home.
http://drupal.org/project/signup_counts
Comment #12
DuaelFrThis version of Signup is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.
Comment #13
Simon Georges CreditAttribution: Simon Georges commentedReverting recent closing.