I know there are a couple of issues about signups not closing when limits are reached, but this looks like a different issue.

Repeatable:

Always

Steps to repeat:

  1. Specify a default status for signups at admin/settings/signup_status.
  2. Enable & configure per-status limits for node at node/%/signups/settings. Use a low limit for the default status from (1) so that you'll be able to reach the limit with few signups.
  3. Signup users via the node's signup form — using the default status from (1) — until the status is full (number of signups = the limit for the status).
  4. View the node's signup form with a non-admin user who is not currently signed up for the node.

Expected results:

For a non-admin user, the default status will not appear as an option on the signup form because it has reached its limit on signups. (per the comments under signup_status_limit_alter_signup_form()).

Actual results:

The default status appears as an option on the form anyway.

The reason appears to be in signup_status_limit_alter_signup_status_element():

$current_status = $element['#default_value'];

The code assumes that $element['#default_value'] is only set when there's an existing signup. But it's also set by the module's default status config to make the form default to the default status for new signups.

Proposed solution:

Pass $form to signup_status_limit_alter_signup_status_element() so the existence of a signup for the user can be tested when setting $current_status.

Patch coming.

CommentFileSizeAuthor
#1 signup_status_limit-694312-01.patch2.87 KBkentr

Comments

kentr’s picture

Status: Active » Needs review
StatusFileSize
new2.87 KB
kentr’s picture

Status: Needs review » Closed (outdated)