Skip to content

Commit

Permalink
[mms] Fix regression in copying a rule when storing in SQL backend (B…
Browse files Browse the repository at this point in the history
…ug #13213).
  • Loading branch information
slusarz committed May 22, 2014
1 parent d62291b commit 75e6c92
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ingo/docs/CHANGES
Expand Up @@ -2,6 +2,8 @@
v3.2.0-git
----------

[mms] Fix regression in copying a rule when storing in SQL backend (Bug
#13213).


-----------
Expand Down
12 changes: 11 additions & 1 deletion ingo/lib/Storage/Filters/Sql.php
Expand Up @@ -239,7 +239,17 @@ public function copyRule($id)
$newrule = $this->_filters[$id];
$newrule['name'] = sprintf(_("Copy of %s"), $this->_filters[$id]['name']);
$this->addRule($newrule, false);
$this->ruleUp(count($this->_filters) - 1, count($this->_filters) - $id - 2);

$rules = array();
foreach (array_slice($this->_filters, 0, -1) as $key => $val) {
$rules[$key] = $val;
if ($key == $id) {
$end = end($this->_filters);
$rules[key($this->_filters)] = current($this->_filters);
}
}

$this->sort($rules);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions ingo/package.xml
Expand Up @@ -33,7 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
*
* [mms] Fix regression in copying a rule when storing in SQL backend (Bug #13213).
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1433,7 +1433,7 @@
<date>2014-05-21</date>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
*
* [mms] Fix regression in copying a rule when storing in SQL backend (Bug #13213).
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 75e6c92

Please sign in to comment.