Archive | July, 2006

Horde/Imp not displaying text of message

6 Jul

Trying to get property of non-object in /var/www/webmail/horde-2.2.3/imp/message.php on line 157,

 

I was getting this and also:  PHP Notice:  Trying to get property of non-object in /var/www/webmail/horde-2.2.3/imp/lib/IMP.php on line 1050

 

When I tried moving my horde installation from php4 to php5.

 

Looking at: lib/MIME/Viewer.php on about line 40 we see: 

   function &factory(&$mime_part)
    {
        global $mime_drivers_map, $mime_drivers, $registry;

        /* Check that we have a valid MIME_Part object */
       if (!is_object($mime_part) || (get_class($mime_part) != 'mime_part')) {

      return false;       

    } 

 

This is wrong as in php5 it was for some reason called 'MIME_Part'. So i changed it below and now things work:

  function &factory(&$mime_part)
    {
        global $mime_drivers_map, $mime_drivers, $registry;

        /* Check that we have a valid MIME_Part object */
        if (!is_object($mime_part) || (get_class($mime_part) != 'mime_part' && get_class($mime_part) != 'MIME_Part')) {
            return false;
        }