Would someone please explain me why is signup limit set to 0 on node submission? and what does this code is expected to achieve?

    // submit
    if ($op == 'submit') {
      global $form_values;
      // Programmatically set (override) the overall signup limit.
      // We do this here to be sure it happens before the insert / update hooks are called.
      $node->signup_close_signup_limit = 0;
      $codes = signup_status_codes();
      foreach ($codes as $cid => $code) {
        $limit = $node->signup_status_close_cid_limits[$cid];
        $node->signup_close_signup_limit += ($limit == -1 ? 0 : $limit);
      }
      $form_values['signup_close_signup_limit'] = $node->signup_close_signup_limit;
    }

this is causing that whenever I edit a node, the singup limit is set to 0... the new $limit value doesn´t makes sense here since there´s no $node->signup_status_close_cid_limits member in $node ¿?

I´m using signup 5.x-2.7 and signup_status 5.x-1.1.

Most probably related to issue #242061: Signups not getting closed automatically which seems to have been reopened a while ago... any clue?

Comments

patricio.keilty’s picture

Solved. It ended up being a problem with invocation order of hooks in signup module: I had installed the newer signup module under sites/default/modules but signup_status was installed under sites/all/modules, causing signup_status hooks being invoked before signup's.
So, beware where you place dependent modules, weird things may happen when modules are tighly coupled and hooks are not called on expected order.

patricio.keilty’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -signup status, -singup limit

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