diff --git a/lib/Alchemy/Phrasea/Helper/User/Edit.php b/lib/Alchemy/Phrasea/Helper/User/Edit.php index 7da3ebe99a..19164e45b1 100644 --- a/lib/Alchemy/Phrasea/Helper/User/Edit.php +++ b/lib/Alchemy/Phrasea/Helper/User/Edit.php @@ -569,7 +569,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper $parm = $request->get_parms_from_serialized_datas($infos, 'user_infos'); - if (!\mail::validateEmail($parm['email'])) + if ($parm['email'] && !\mail::validateEmail($parm['email'])) throw new \Exception_InvalidArgument(_('Email addess is not valid')); $user->set_firstname($parm['first_name']) @@ -589,7 +589,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper public function apply_template() { - $appbox = appbox::get_instance(); + $appbox = \appbox::get_instance(); $session = $appbox->get_session(); $template = \User_adapter::getInstance($this->request->get('template'), $appbox); diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index 50f590a46e..27a4804f77 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -1145,8 +1145,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface try { + $appbox = \appbox::get_instance(); + $session = $appbox->get_session(); + $connbas = connection::getPDOConnection($this->get_sbas_id()); - + $sql = 'DELETE FROM subdef WHERE record_id= :record_id AND name=:name'; $stmt = $connbas->prepare($sql); $stmt->execute( @@ -1165,7 +1168,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface (:record_id, :name, :baseurl, :filename, :width, :height, :mime, :path, :filesize, "1")'; - echo "substitute subdef $name with $base_url ".$system_file->getPath()." ".$system_file->getFilename()."
"; $stmt = $connbas->prepare($sql); $stmt->execute(array( @@ -1183,11 +1185,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface $sql = 'UPDATE record SET moddate=NOW() WHERE record_id=:record_id'; $stmt = $connbas->prepare($sql); $stmt->execute(array(':record_id' => $this->get_record_id())); - $stmt->execute(); + $stmt->closeCursor(); $this->delete_data_from_cache(self::CACHE_SUBDEFS); - if ($meta_writable) { $this->write_metas(); @@ -1199,15 +1200,14 @@ class record_adapter implements record_Interface, cache_cacheableInterface $type = $name == 'document' ? 'HD' : $name; - $session->get_logger($record->get_databox()) - ->log($record, Session_Logger::EVENT_SUBSTITUTE, $type, ''); + $session->get_logger($this->get_databox()) + ->log($this, Session_Logger::EVENT_SUBSTITUTE, $type, ''); } catch (Exception $e) { unset($e); } - return $this; } diff --git a/templates/web/admin/editusers.twig b/templates/web/admin/editusers.twig index 4673464aaf..37cda2aed5 100644 --- a/templates/web/admin/editusers.twig +++ b/templates/web/admin/editusers.twig @@ -438,7 +438,7 @@ {% if main_user is not empty and main_user.is_template is empty and main_user.is_special is empty %} -
+