From b92f45ca650243c32769fa31678ef1bf8c0ece9f Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Fri, 27 Feb 2015 09:47:07 -0500 Subject: [PATCH] Bug: 13884 Fix adding tags to new contacts. --- turba/lib/Driver.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/turba/lib/Driver.php b/turba/lib/Driver.php index 62a7ad1a712..f3f430afcc0 100644 --- a/turba/lib/Driver.php +++ b/turba/lib/Driver.php @@ -905,15 +905,21 @@ public function add(array $attributes) $key = $attributes['__key'] = $this->_makeKey($this->toDriverKeys($attributes)); $uid = $attributes['__uid']; + /* Remember any tags, since toDriverKeys will remove them. + (They are not stored in the Turba backend so have no mapping). */ + $tags = isset($attributes['__tags']) + ? $attributes['__tags'] + : false; + $attributes = $this->toDriverKeys($attributes); $this->_add($attributes, $this->toDriverKeys($this->getBlobs()), $this->toDriverKeys($this->getDateFields())); /* Add tags. */ - if (isset($attributes['__tags'])) { + if ($tags !== false) { $GLOBALS['injector']->getInstance('Turba_Tagger')->tag( $uid, - $attributes['__tags'], + $tags, $GLOBALS['registry']->getAuth(), 'contact' );