6.0.0-beta1
7/6/25

[#13732] [move_innocent_after_report'] not set globally
Summary [move_innocent_after_report'] not set globally
Queue IMP
Queue Version 6.2.3
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester sascha (at) schmidt (dot) ps
Created 12/02/2014 (3869 days ago)
Due
Updated 12/03/2014 (3868 days ago)
Assigned 12/02/2014 (3869 days ago)
Resolved 12/03/2014 (3868 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/03/2014 08:24:07 PM Michael Slusarz Comment #8
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Horde_Prefs 2.7.1
12/03/2014 08:23:25 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (master):

commit 690d731b354f8faaa19c09caae2c636a58758ac6
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Wed Dec 3 13:21:39 2014 -0700

     [mms] Fix Horde_Prefs#isDefault() to return true if the given 
pref name doesn't exist in a scope.

     Since the pref is not defined, whatever value given should be considered
     the default.

     Ticket #13732

  framework/Prefs/lib/Horde/Prefs.php |    2 +-
  framework/Prefs/package.xml         |    4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/690d731b354f8faaa19c09caae2c636a58758ac6
12/03/2014 07:58:20 PM sascha (at) schmidt (dot) ps Comment #6 Reply to this comment
I've switched on Horde DEBUG Loggin.

If I don't have the "ham" preference within the prefs.local.php I can 
see the following line in the log:

2014-12-03T20:54:27+01:00 DEBUG: HORDE [imp] Horde_Prefs: Storing 
preference value (upgrade_tasks) [pid 13051 on line 148 of 
"/var/www/pub/horde/pear/php/Horde/Core/LoginTasks/SystemTask/Upgrade.php"]

If I've configured the ham preference this line does not appear.
Extremely.  That code is run once, and only when upgrading from IMP 
< 6 -> IMP 6.
The location and name of this Upgrade script makes me think that this 
script will be run at every system login...

Btw. I'm testing on a nearly fresh install.
12/03/2014 07:16:09 PM Michael Slusarz Comment #5 Reply to this comment
Strange?
Extremely.  That code is run once, and only when upgrading from IMP < 
6 -> IMP 6.

Upgrades are kept track of in the 'upgrade_tasks' preference, so it 
looks like that preference isn't working/being saved on your system 
correctly.
12/03/2014 06:39:57 PM sascha (at) schmidt (dot) ps Comment #4 Reply to this comment
I'v looked into imp/lib/LoginTasks/SystemTask/Upgrade.php and found 
that 2 variables are handled for this task.

if (!$prefs->isDefault('move_ham_after_report')) {
             $prefs->setValue('move_innocent_after_report', 
$prefs->getValue('move_ham_after_report'));

After setting both variables with the desired value, it worked.

$_prefs['move_innocent_after_report']['value'] = '1';
$_prefs['move_ham_after_report']['value'] = '1';

Strange?
12/03/2014 06:23:51 PM sascha (at) schmidt (dot) ps Comment #3 Reply to this comment
root@$:/var/www/pub/horde/imp/config# grep -r move_innocent_after_report *
prefs.local.php:$_prefs['move_innocent_after_report']['value'] = '1';
prefs.php:        'spamselect', 'delete_spam_after_report', 
'move_innocent_after_report',
prefs.php:$_prefs['move_innocent_after_report'] = array(
prefs.php:    'help' => 'prefs-move_innocent_after_report',
root@$:/var/www/pub/horde/imp/config#

prefs.local.php should override the prefs.php value as it does for the 
delete_spam_after_report value...


12/02/2014 10:54:42 PM Michael Slusarz Comment #2
Priority ⇒ 1. Low
State ⇒ Feedback
Reply to this comment
After configuring $_prefs['move_innocent_after_report']['value'] 
within prefs.local.php within the IMP path, this setting has _no 
effect on the global configuration_. New users still need to 
configure this value manually.
Can't reproduce.
I've tested this with new users. And with existing users where I've 
run the mysql statement "DELETE FROM horde_prefs...."
Even though you said you did this, your description sounds exactly 
like this is still the issue: you have existing prefs still remaining 
in your prefs backend.

Either that or you have a move_ham_after_report preference still 
existing in your prefs backend and, for some reason, the upgrade 
script is running on every login and copying over that old value.
delete_spam_after_report for example, works.
Considering the code handling innocent and spam after report is 
identical (they are both used in only 1 place), this is more evidence 
that your prefs backend is not pristine.
12/02/2014 01:27:25 PM sascha (at) schmidt (dot) ps Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ [move_innocent_after_report'] not set globally
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
After configuring $_prefs['move_innocent_after_report']['value'] 
within prefs.local.php within the IMP path, this setting has _no 
effect on the global configuration_. New users still need to configure 
this value manually.

I've tested this with new users. And with existing users where I've 
run the mysql statement "DELETE FROM horde_prefs...."

delete_spam_after_report for example, works.


Saved Queries