Skip to content

Commit

Permalink
Bug: 14471 Fix sorting by a name field.
Browse files Browse the repository at this point in the history
This regression is related to Bug: 14463, as it was introduced with
the same change. In this case, since when we are sorting by a name field,
we use a "private" __lastname and __firstname attribute which
is not known by the driver's map, so it is ignored.
  • Loading branch information
mrubinsk committed Sep 18, 2016
1 parent cf07d18 commit 5b62a78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions turba/lib/Object.php
Expand Up @@ -194,9 +194,10 @@ public function setValue($attribute, $value)
} catch (Turba_Exception $e) {}
}

// If we don't know the attribute, and it's an email field, save it
// in case we need to populate an email field on save.
if (!isset($this->driver->map[$attribute]) && $attribute != '__tags') {
// If we don't know the attribute, it's not a private attribute,
// and it's an email field, save it in case we need to populate an email
// field on save.
if (!isset($this->driver->map[$attribute]) && strpos($attribute, '__') === false) {
if (isset($attributes[$attribute]) &&
$attributes[$attribute]['type'] == 'email') {
$this->_emailFields[$attribute] = $value;
Expand Down

0 comments on commit 5b62a78

Please sign in to comment.