From 10cab0374c343f99014e405e2361a1c9bc501677 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 11 Jan 2012 11:01:22 +0100 Subject: [PATCH 1/4] Fix substitute --- lib/classes/record/adapter.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index 190ad453e6..62523c034c 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -1063,8 +1063,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( @@ -1083,7 +1086,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( @@ -1101,11 +1103,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(); @@ -1117,15 +1118,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; } From 5c8d00397cd7562f7442b9ecf77a2382c949b830 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 11 Jan 2012 11:18:13 +0100 Subject: [PATCH 2/4] Allox usr_mail to be null --- lib/classes/module/admin/route/users/edit.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/module/admin/route/users/edit.class.php b/lib/classes/module/admin/route/users/edit.class.php index 04cc3427c4..b849a1a9f2 100644 --- a/lib/classes/module/admin/route/users/edit.class.php +++ b/lib/classes/module/admin/route/users/edit.class.php @@ -572,7 +572,7 @@ class module_admin_route_users_edit $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']) From 85f44ce8c50da6a047ef855564fcb040d72c00ed Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 11 Jan 2012 11:24:01 +0100 Subject: [PATCH 3/4] Do not alert when validation is finished --- lib/classes/basketCollection.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/classes/basketCollection.class.php b/lib/classes/basketCollection.class.php index b4045de7e0..d85b4e44ee 100644 --- a/lib/classes/basketCollection.class.php +++ b/lib/classes/basketCollection.class.php @@ -163,7 +163,13 @@ class basketCollection { try { - $baskets[] = basket_adapter::getInstance($appbox, $row['ssel_id'], $session->get_usr_id()); + $basket = basket_adapter::getInstance($appbox, $row['ssel_id'], $session->get_usr_id()); + + if ($basket->is_valid() && !$basket->is_my_valid() && $basket->is_validation_finished()) + throw new Exception('Finished'); + + $baskets[] = $basket; + } catch(Exception $e) { From de7931f7e2972553fecfcc8528fcee2950f2ea49 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 11 Jan 2012 11:25:32 +0100 Subject: [PATCH 4/4] Fix user_infos_tab overflow --- templates/web/admin/editusers.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 %} -
+