<?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>Ingo does not store spam preferences</title> 
  <pubDate>Fri, 10 Apr 2026 13:16:49 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7033</link> 
  <atom:link rel="self" type="application/rss+xml" title="Ingo does not store spam preferences" href="https://bugs.horde.org/ticket/7033/rss" /> 
  <description>Ingo does not store spam preferences</description> 
 
   
   
  <item> 
   <title>When running Imp and Ingo, Ingo does not store the spam pref</title> 
   <description>When running Imp and Ingo, Ingo does not store the spam preferences correctly. The problem is in the following code (lib/Storage/prefs.php):



case INGO_STORAGE_ACTION_SPAM:

             $ob = new Ingo_Storage_spam();

             $data = @unserialize($prefs-&gt;getValue(&#039;spam&#039;));



Here, $prefs has previously been loaded to point to Ingo&#039;s preferences. However, within the constructor of Ingo_Storage_spam, the preference object is invalidated by changing the preference object&#039;s scope, as Imp&#039;s preferences are loaded:



        if (in_array(&#039;imp&#039;, $GLOBALS[&#039;registry&#039;]-&gt;listApps())) {

            $prefs = &amp;Prefs::singleton($GLOBALS[&#039;conf&#039;][&#039;prefs&#039;][&#039;driver&#039;],

                                       &#039;imp&#039;, Ingo::getUser(), &#039;&#039;, null, false);

            $prefs-&gt;retrieve();

            [...]



To solve this, I changed Ingo&#039;s code to read



         case INGO_STORAGE_ACTION_SPAM:

             $ob = new Ingo_Storage_spam();

             $prefs-&gt;retrieve($GLOBALS[&#039;registry&#039;]-&gt;getApp());

             $data = @unserialize($prefs-&gt;getValue(&#039;spam&#039;));



So the preferences are reloaded after the construction call. Alternatively, only resetting the scope should also be sufficient. This solves the problem, but I admit it may not be the most preferable solution. I think that Prefs::singleton() should allow to cache preference objects with different scopes separately, which is currently disallowed (horde/lib/Horde/Prefs.php):



        if (!isset($instances[$signature])) {

            $instances[$signature] = &amp;Prefs::factory($driver, $scope, $user, $password, $params, $caching);

        }



        /* Preferences may be cached with a different scope. */

        $instances[$signature]-&gt;setScope($scope);



If you want, I&#039;ll submit that as a separate Horde framework bug.

</description> 
   <pubDate>Sun, 06 Jul 2008 19:39:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7033#t47306</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/ingo/lib/Storage.php?r1=1.84&amp;r2=1.85&amp;ty=u</description> 
   <pubDate>Sun, 06 Jul 2008 22:25:29 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7033#t47321</link> 
  </item> 
   
  <item> 
   <title>Please try what I committed instead.</title> 
   <description>Please try what I committed instead.</description> 
   <pubDate>Sun, 06 Jul 2008 22:25:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7033#t47322</link> 
  </item> 
   
  <item> 
   <title>&gt; Please try what I committed instead.



It works, thanks.
</title> 
   <description>&gt; Please try what I committed instead.



It works, thanks.

</description> 
   <pubDate>Mon, 07 Jul 2008 06:33:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7033#t47338</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
