6.0.0-beta1
7/5/25

[#4370] enable / disable, moving of rules, not being saved the first time
Summary enable / disable, moving of rules, not being saved the first time
Queue Ingo
Queue Version HEAD
Type Bug
State No Feedback
Priority 2. Medium
Owners Horde Developers (at) , jan (at) horde (dot) org
Requester bruno (at) konjz (dot) org
Created 08/31/2006 (6883 days ago)
Due
Updated 12/18/2007 (6409 days ago)
Assigned 04/25/2007 (6646 days ago)
Resolved 05/21/2007 (6620 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/18/2007 06:47:42 PM Jan Schneider Comment #8
New Attachment: ingo_storage.diff Download
Reply to this comment
Can you please try if the attached patch fixes this for you?
06/27/2007 05:57:46 PM lennon (at) reed (dot) edu Comment #7 Reply to this comment
We're still getting occasional reports of this issue affecting users 
here at Reed, even with the patch.
05/21/2007 01:40:41 PM Jan Schneider State ⇒ No Feedback
 
05/10/2007 08:55:31 AM Jan Schneider Comment #6 Reply to this comment
Do you guys still see this, and if yes, can you determine any common 
denominator that might cause this?
04/25/2007 03:06:53 PM Jan Schneider Comment #5
State ⇒ Feedback
Reply to this comment
I can't reproduce this, with any storage driver.
04/17/2007 05:40:40 PM lennon (at) reed (dot) edu Comment #4 Reply to this comment
Dominik's patch appears to work in our environment, and after being 
appropriately modified for 'rule.php', 'whitelist.php', etc., appears 
to be a more general solution, as well. The "right way" to solve to 
problem, going forward, would probably be to have 'lib/base.php' 
pre-fetch the various filter types...perhaps even exposing them via 
named methods like '$ingo_storage->vacation()' to save us all a few 
keystrokes typing those long INGO_STORAGE_ACTION_* constants? (hint, 
hint...)
03/27/2007 07:03:52 PM dgehl (at) inverse (dot) ca Comment #3 Reply to this comment
I just found a way to fix this problem on the vacation.php page (a fix 
for the other pages should be similar). In fact, the problem seems to 
be that not all filter objects are loaded when the first save happens. 
In my case, I noticed that when the first save in vacation.php failed, 
the whitelist filter got loaded and then, when trying to save the 
second time (this one successful), the whitelist filter did not get 
loaded again.



So to fix the problem in vacation.php, I added all filter objects to 
the beginning of the page, which became



/* Get vacation object and rules. */

$vacation = &$ingo_storage->retrieve(INGO_STORAGE_ACTION_VACATION);

$filters = &$ingo_storage->retrieve(INGO_STORAGE_ACTION_FILTERS);



#added to fix http://bugs.horde.org/ticket/comment.php?id=4370

$whitelist = &$ingo_storage->retrieve(INGO_STORAGE_ACTION_WHITELIST);

$forward = &$ingo_storage->retrieve(INGO_STORAGE_ACTION_FORWARD);

$blacklist = &$ingo_storage->retrieve(INGO_STORAGE_ACTION_BLACKLIST);

$spam = &$ingo_storage->retrieve(INGO_STORAGE_ACTION_SPAM);

#end fix



$vac_id = $filters->findRuleId(INGO_STORAGE_ACTION_VACATION);

$vac_rule = $filters->getRule($vac_id);


09/25/2006 05:00:47 PM Jan Schneider Assigned to Jan Schneider
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
09/19/2006 12:41:11 AM bruno (at) konjz (dot) org Comment #2 Reply to this comment
Some debug info. I log in, select Mail, then Filters. I want to turn 
on default Spam Filter. It has a red cross under disabled column. I 
click on it, and from horde.log:

-----

Sep 18 20:32:10 HORDE [debug] [] SQL Query by 
DataTree_sql::_buildParentIds(): SELECT datatree_id, datatree_p

arents FROM horde_datatree WHERE datatree_name = ? AND group_uid = ? 
ORDER BY datatree_id [on line 275 of "/v

ar/www/pear/lib/Horde/DataTree/sql.php"]

Sep 18 20:32:10 HORDE [debug] [] SQL Query by DataTree_sql::_load(): 
SELECT c.datatree_id, c.datatree_name, c

.datatree_parents, c.datatree_order FROM horde_datatree c WHERE 
c.group_uid = 'horde.perms'  [on line 144 of

"/var/www/pear/lib/Horde/DataTree/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_v

alue FROM horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR 
pref_scope = 'horde') ORDER BY pref_scope [on

  line 159 of "/var/www/pear/lib/Horde/Prefs/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_v

alue FROM horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR 
pref_scope = 'horde') ORDER BY pref_scope [on

  line 159 of "/var/www/pear/lib/Horde/Prefs/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_v

alue FROM horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR 
pref_scope = 'horde') ORDER BY pref_scope [on

  line 159 of "/var/www/pear/lib/Horde/Prefs/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_v

alue FROM horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR 
pref_scope = 'horde') ORDER BY pref_scope [on

  line 159 of "/var/www/pear/lib/Horde/Prefs/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_v

alue FROM horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR 
pref_scope = 'horde') ORDER BY pref_scope [on

  line 159 of "/var/www/pear/lib/Horde/Prefs/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
DataTree_sql::_buildParentIds(): SELECT datatree_id, datatr

ee_parents FROM horde_datatree WHERE datatree_name = ? AND group_uid = 
? ORDER BY datatree_id [on line 275 of

  "/var/www/pear/lib/Horde/DataTree/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
DataTree_sql::_load(): SELECT c.datatree_id, c.datatree_nam

e, c.datatree_parents, c.datatree_order FROM horde_datatree c WHERE 
c.group_uid = 'horde.perms'  [on line 144

  of "/var/www/pear/lib/Horde/DataTree/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
DataTree_sql::_buildParentIds(): SELECT datatree_id, datatr

ee_parents FROM horde_datatree WHERE datatree_name = ? AND group_uid = 
? ORDER BY datatree_id [on line 275 of

  "/var/www/pear/lib/Horde/DataTree/sql.php"]

Sep 18 20:32:11 HORDE [debug] [ingo] SQL Query by 
DataTree_sql::_load(): SELECT c.datatree_id, c.datatree_nam

e, c.datatree_parents, c.datatree_order FROM horde_datatree c WHERE 
c.group_uid = 'horde.perms'  [on line 144

  of "/var/www/pear/lib/Horde/DataTree/sql.php"]

-----



The red cross turns into green checkmark. On top it says:

"Rule Enabled"

"Script successfully activated"



On backend, indeed there is an entry in ingo.script.

I log out, log back in, go to Mail -> Filters, and instead of seeing a 
green checkmark for Spam Filter, there is a red cross. Still, it is 
enabled on backend imap server.



CVS HEAD, SQL DB for preferances, Horde defaults.

In Ingo, for storage driver selected is "preferences system".


08/31/2006 12:24:27 AM bruno (at) konjz (dot) org Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Queue ⇒ Ingo
Summary ⇒ enable / disable, moving of rules, not being saved the first time
Type ⇒ Bug
Reply to this comment
What I see is similar to ticket #3825. This only happens the first 
time, and it happens with creating a new rule, moving rules up/down, 
and enabling or disabling a rule. For example, after I log in and go 
to create a new rule, and hit save, it doesn't really save it to the 
database. It does show up on the filter rule screen. If I then "edit" 
the rule, and hit save again, it does get saved to the database. It is 
similar with other things, like moving rules up or down, the first 
time after a login it doesn't work, but after doing it once or twice, 
the database gets updated. Same with enabling or disabling a rule, 
using sieve as well, the sieve server gets updated every time, but the 
first time the sql doesn't seem to do an update. Using 'prefs' for 
storage driver, and cvs head.


Saved Queries