[ingo] Can't add more than 1 rule

Alexander Skwar lists.ASkwar at email-server.info
Mon Apr 28 23:03:01 PDT 2003


I wrote:

> In latest Ingo from HEAD, when I click on add it "reuses" the last added
> rule.  IOW: It doesn't create a new rule but uses the existing.
> 
> When I try to save save it, it "overwrites" the existing rule.

This error seems to be related to the "Undefined index: edit" error
which I'm currently trying to hunt.

If a new rule is to be created, filters.php is called with an actionID
of 304, ie. INGO_RULE_NEW.  If filters.php is called with this actionID,
 it'll get to about line 61, which has:

case INGO_RULE_NEW:
    $_SESSION['ingo']['edit'] = $id;
    header('Location: ' . Horde::applicationUrl('rule.php'));

$id is set at about line 51 of the same file:

if ($actionID == INGO_RULE_NEW) {
    $rules[] = array();
    $id = max(array_keys($rules));

Okay, we were at about line 61 of filters.php and got redirected to
rule.php.  It is supposed that the session array 'ingo' now has a key
with the id for the new rule.  When there are no user defined rules, the
new rule should get rulenumber 3.

However, in rule.php, the key edit is UNSET!  Here's a var_dump of my
ingo array:

ingo:
array(2) {
  ["storage"]=>
  &object(ingo_storage_prefs)(1) {
    ["_params"]=>
    array(0) {
    }
  }
  ["filters"]=>
  array(3) {
    [0]=>
    array(2) {
      ["name"]=>
      string(9) "Blacklist"
      ["action"]=>
      int(7)
    }
    [1]=>
    array(2) {
      ["name"]=>
      string(8) "Vacation"
      ["action"]=>
      int(8)
    }
    [2]=>
    array(2) {
      ["name"]=>
      string(9) "Whitelist"
      ["action"]=>
      int(9)
    }
  }
}

As you can see, there's no key called edit.  I also had a look at the
session file on the server, and it too doesn't contain the string "edit".

Hmm, it seems the ingo array in the session isn't updated properly.  At
about line 45 of filters.php, there's:

$_SESSION['ingo']['symbolic_rules_checked'] = true;

As you can see from the var_dump, symbolic_rules_checked isn't
propergated to rules.php.

However, it seems to have something to do with the array.  In
filters.php at the lines where it should set the 'edit' key, I've also
set a new session variable "alexander" to the value "skwar".  This
session variable gets propergated properly.

So, for some reason, the session doesn't seem to get updated properly.
This is with PHP 4.3.2RC1 on Debian Woody i386 and Apache 1.3.26.

I'm out of ideas about why in rule.php 'edit' (and also
'symbolic_rules_checked' for that matter...) is unset.

Anyone else?

Alexander Skwar
-- 
Signatur vorübergehend deaktiviert.



More information about the ingo mailing list