diff --git a/apps/contactsinteraction/lib/Db/RecentContact.php b/apps/contactsinteraction/lib/Db/RecentContact.php index 475de09341978..e6c379d0aa15b 100644 --- a/apps/contactsinteraction/lib/Db/RecentContact.php +++ b/apps/contactsinteraction/lib/Db/RecentContact.php @@ -66,7 +66,7 @@ public function __construct() { $this->addType('uid', 'string'); $this->addType('email', 'string'); $this->addType('federatedCloudId', 'string'); - $this->addType('card', 'string'); + $this->addType('card', 'blob'); $this->addType('lastContact', 'int'); } } diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 954b8787c4c64..34719c82aea76 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -110,7 +110,12 @@ protected function setter($name, $args) { // if type definition exists, cast to correct type if ($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) { - settype($args[0], $this->_fieldTypes[$name]); + $type = $this->_fieldTypes[$name]; + if ($type === 'blob') { + // (B)LOB is treated as string when we read from the DB + $type = 'string'; + } + settype($args[0], $type); } $this->$name = $args[0]; } else { diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 9b396965706d7..ebbe92e7875f7 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -230,6 +230,8 @@ protected function getParameterTypeForProperty(Entity $entity, string $property) case 'bool': case 'boolean': return IQueryBuilder::PARAM_BOOL; + case 'blob': + return IQueryBuilder::PARAM_LOB; } return IQueryBuilder::PARAM_STR;