6.0.0-alpha12
6/7/25

[#8484] saving prefs to files preserves the dirty flag
Summary saving prefs to files preserves the dirty flag
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners thomas.jarosch (at) intra2net (dot) com, wrobel (at) horde (dot) org
Requester reg (at) debian (dot) org
Created 08/08/2009 (5782 days ago)
Due
Updated 09/09/2009 (5750 days ago)
Assigned 08/08/2009 (5782 days ago)
Resolved 09/09/2009 (5750 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
09/09/2009 08:11:45 PM Gunnar Wrobel Comment #4
State ⇒ Resolved
Reply to this comment
I consider this resolved. Some testing will still be done but this 
will be tracked in the corresponding Kolab issue.
09/09/2009 08:06:24 PM CVS Commit Comment #3 Reply to this comment
Changes have been made in CVS for this ticket:

Fix the file based preferences driver. Only the preferences values 
should get saved (not the mask or the defaults). This changes the file 
format which should be automatically converted once preference data 
with version 1 has been loaded. Bug #8484.
http://cvs.horde.org/diff.php/framework/Prefs/Prefs/file.php?rt=horde&r1=1.1.2.3&r2=1.1.2.4&ty=u
09/09/2009 07:44:19 PM Gunnar Wrobel Comment #2 Reply to this comment
Corresponding bug in the Kolab tracker:



https://issues.kolab.org/issue3555



Thanks for the report as well as the fix.



The suggested line will hotfix the behavior but the actual problem 
lies deeper.



The Prefs/file.php driver completely dumps the preferences information into a

serialized array. That is not exactly what saving preferences is about and all

other drivers only save the preference values actually changed.



I should be able to fix that but this means I'll have to transparently convert

the old file format to the new format.



In the meantime it should be okay to use the hotfix as the format 
conversion should not be affected by it.
08/08/2009 11:41:23 AM Jan Schneider Version ⇒ FRAMEWORK_3
 
08/08/2009 11:40:57 AM Jan Schneider State ⇒ Assigned
Assigned to Thomas Jarosch
Assigned to Gunnar Wrobel
 
08/08/2009 01:12:16 AM reg (at) debian (dot) org Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ saving prefs to files preserves the dirty flag
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Hi,



I forward you a bug reported by a Debian user

(http://bugs.debian.org/538027) :



The file backend of the Prefs subsystem (lib/Horde/Prefs/file.php) dumps

the content to a file as it is represented in memory (cache), including

the dirty flag. This has as a consequence that everything marked dirty

may prevent the user from subsequent changes: if there's another instance

of the Prefs class that's destroying after the instance that made the

changes, the changes will be overwritten with the original content and

seemingly nothing will have changed. I stumbled upon the bug when trying

out the cyrus, imp and kolab: I set up e-mail filters, but after logging

out and again logging in I couldn't add any more filters: they were added

in the GUI, but in fact they weren't written to the disk, which could be

confirmed by a logout/login cycle.

I changed the relevant file (lib/Horde/Prefs/file.php) so, that the

store() function clears dirty flags before writing the content to the

file. This removes the bug.

The relevant patch is:



--- lib/Horde/Prefs/file.php.orig        2008-09-10 12:31:51.000000000 +0200

+++ lib/Horde/Prefs/file.php        2009-07-22 16:56:27.000000000 +0200

@@ -209,6 +209,7 @@

                  }



                  $this->_file_cache[$scope][$name] = $pref;

+                $this->_file_cache[$scope][$name]['m'] &= ~_PREF_DIRTY;

              }

          }


Saved Queries