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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Status: Needs review » Postponed

Looks great to me. Marking postponed until #143888 lands. Thanks! (FYI: see also #179585: Signup count field in Views 7.x)

altparty’s picture

Is 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)?

dww’s picture

No. 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? ;)

altparty’s picture

Your 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.

reubenavery’s picture

I'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 :-)

reubenavery’s picture

FileSize
1.53 KB

Hi, 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.

MilOrg’s picture

reubidium - that one did exactly what I was looking for.

Why not make it a project?

Good job :-)

MasterChief’s picture

Hi 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 :)

alfiozzz’s picture

@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 :)

reubenavery’s picture

Hi 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..

kepford’s picture

reubidium's module Signup Counts now has a permanent home.
http://drupal.org/project/signup_counts

DuaelFr’s picture

Status: Postponed » Closed (won't fix)

This 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.

Simon Georges’s picture

Status: Closed (won't fix) » Postponed

Reverting recent closing.