Unfortunately the latest version of the module has an issue with how it handles the signup limits. This is do to a misnamed-variable call used twice. The _signup_check_limit() function works as expected but when creating a new signup (when the user is signing up for something) that function wasn't executing at all. I've attached a patch that fixes this issue.

CommentFileSizeAuthor
signup_limit.patch606 bytesagileadam

Comments

agileadam’s picture

Status: Patch (to be ported) » Needs review
flaviovs’s picture

I experienced this issue this week. Did some manual test and confirmed that signup limit was not being obeyed, at least for anonymous signups. I applied the patch above and now signup limit is working as expected.

joachim’s picture

Status: Needs review » Needs work
$ ack count_towards_total
signup.module
1265:    $signup->count_towards_total = 1;
1298:    if (!empty($signup->count_towards_total)) {
1299:      $node->signup_effective_total += $signup->count_towards_total;

I get three results for that string. Looks like you've missed one! ;)

Gremdel’s picture

Thanks for the patch, saved me some trouble.

@joachim: That's not in my copy of SignUp, I think you may have some custom code there. Adding "$signup->count_towards_total = 1;" would fix the bug, but probably causes other bugs.

Gremdel’s picture

Status: Needs work » Needs review
Jonah Ellison’s picture

I applied keystr0k's patch and it resolved this issue.

I also have signup_guests installed... if anyone else is using this module, then you'll need to patch the signup_guests_signup_update() function by adding this at the end:

  if (!empty($signup->count_towards_limit)) {
    $node = node_load($signup->nid, NULL, TRUE); // Don't grab cached node
    _signup_check_limit($node, 'total');
  }
socialnicheguru’s picture

sub

echoz’s picture

signup_limit.patch works for me (hand patched 6.x-1.0-rc6), thanks keystr0k!

echoz’s picture

Now I've discovered that dww's patch in #2 of #597808: Signup does not close when limit is reached which is already in the dev version fixes this, and then the patch here is not needed.

ezra-g’s picture

Title: Patch: Fixes auto-closing of signup when limit is reached » Signup not closed when limit reached
Status: Needs review » Fixed

keystr0k is correct that we're using the wrong variable name here -- Rather than $signup->count_towards_total, we should be using $signup->count_towards_limit , which is what is used everywhere else in the module. The patch in #597808: Signup does not close when limit is reached added in a $signup->count_towards_total = 1; , which made things work for the bit of code that was also using this incorrect variable ;). joachim is correct that we need to fix one more occurrence of this.

I made this change, tested and committed:

Thanks!

ezra-g’s picture

Status: Fixed » Closed (fixed)

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