<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>saving prefs to files preserves the dirty flag</title> 
  <pubDate>Thu, 09 Apr 2026 17:31:32 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/8484</link> 
  <atom:link rel="self" type="application/rss+xml" title="saving prefs to files preserves the dirty flag" href="https://bugs.horde.org/ticket/8484/rss" /> 
  <description>saving prefs to files preserves the dirty flag</description> 
 
   
   
  <item> 
   <title>Hi,



I forward you a bug reported by a Debian user 

(http</title> 
   <description>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&#039;s another instance

of the Prefs class that&#039;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&#039;t add any more filters: they were added

in the GUI, but in fact they weren&#039;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-&gt;_file_cache[$scope][$name] = $pref;

+                $this-&gt;_file_cache[$scope][$name][&#039;m&#039;] &amp;= ~_PREF_DIRTY;

             }

         }

 </description> 
   <pubDate>Sat, 08 Aug 2009 01:12:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8484#t55245</link> 
  </item> 
   
  <item> 
   <title>Corresponding bug in the Kolab tracker:



https://issues.ko</title> 
   <description>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&#039;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.</description> 
   <pubDate>Wed, 09 Sep 2009 19:44:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8484#t55715</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

Fix the file</title> 
   <description>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&amp;r1=1.1.2.3&amp;r2=1.1.2.4&amp;ty=u</description> 
   <pubDate>Wed, 09 Sep 2009 20:06:24 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8484#t55716</link> 
  </item> 
   
  <item> 
   <title>I consider this resolved. Some testing will still be done bu</title> 
   <description>I consider this resolved. Some testing will still be done but this will be tracked in the corresponding Kolab issue.</description> 
   <pubDate>Wed, 09 Sep 2009 20:11:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8484#t55717</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
