From 93151d84a3d6df87579c10d569c7ecf99ec524d1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 21 Mar 2014 17:12:32 +0000 Subject: [PATCH] fixed photo was lost after it was no longer transfered to client (to fix utf8 error in json encoding) --- addressbook/inc/class.addressbook_ui.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 41d88d339f..6d5588c2b1 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -1710,7 +1710,11 @@ window.egw_LAB.wait(function() { { case 'save': case 'apply': - if ($content['delete_photo']) $content['jpegphoto'] = null; + if ($content['delete_photo']) + { + $content['jpegphoto'] = null; + unset($content['delete_photo']); + } if (is_array($content['upload_photo']) && !empty($content['upload_photo']['tmp_name']) && $content['upload_photo']['tmp_name'] != 'none' && ($f = fopen($content['upload_photo']['tmp_name'],'r'))) @@ -1868,7 +1872,6 @@ window.egw_LAB.wait(function() { { $view = true; } - $content['jpegphoto'] = !empty($content['jpegphoto']); // unused and messes up json encoding (not utf-8) } else // not found { @@ -2093,6 +2096,7 @@ window.egw_LAB.wait(function() { // allow other apps to add tabs to addressbook edit $preserve = $content; + $content['jpegphoto'] = !empty($content['jpegphoto']); // unused and messes up json encoding (not utf-8) $this->tmpl->setElementAttribute('tabs', 'add_tabs', true); $tabs =& $this->tmpl->getElementAttribute('tabs', 'tabs'); if (true) $tabs = array();