Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-09-04 13:38:16 +0300
committerGitHub <noreply@github.com>2020-09-04 13:38:16 +0300
commitdc60a812842bb879b5b60393e69152716bc5e7fd (patch)
treeddc81e667406a1fc351663ba5621f2141e2e681c
parentc1b971ec639b9dbfee8753214acc4b0545318e28 (diff)
parent7ada6e5ab011f142dfb2bb4312dd3bd1128981da (diff)
Merge pull request #22515 from nextcloud/backport/22472/stable19
[stable19] Fix writing BLOBs to postgres with recent contacts interaction
-rw-r--r--apps/contactsinteraction/lib/Db/RecentContact.php2
-rw-r--r--lib/public/AppFramework/Db/Entity.php7
-rw-r--r--lib/public/AppFramework/Db/QBMapper.php2
3 files changed, 9 insertions, 2 deletions
diff --git a/apps/contactsinteraction/lib/Db/RecentContact.php b/apps/contactsinteraction/lib/Db/RecentContact.php
index 475de093419..e6c379d0aa1 100644
--- a/apps/contactsinteraction/lib/Db/RecentContact.php
+++ b/apps/contactsinteraction/lib/Db/RecentContact.php
@@ -66,7 +66,7 @@ class RecentContact extends Entity {
$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 954b8787c4c..34719c82aea 100644
--- a/lib/public/AppFramework/Db/Entity.php
+++ b/lib/public/AppFramework/Db/Entity.php
@@ -110,7 +110,12 @@ abstract class Entity {
// 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 9b396965706..ebbe92e7875 100644
--- a/lib/public/AppFramework/Db/QBMapper.php
+++ b/lib/public/AppFramework/Db/QBMapper.php
@@ -230,6 +230,8 @@ abstract class QBMapper {
case 'bool':
case 'boolean':
return IQueryBuilder::PARAM_BOOL;
+ case 'blob':
+ return IQueryBuilder::PARAM_LOB;
}
return IQueryBuilder::PARAM_STR;