* {@inheritdoc}
*/
public function getTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag {
+ // Length of name column is 64
+ $truncatedTagName = substr($tagName, 0, 64);
$result = $this->selectTagQuery
- ->setParameter('name', $tagName)
+ ->setParameter('name', $truncatedTagName)
->setParameter('visibility', $userVisible ? 1 : 0)
->setParameter('editable', $userAssignable ? 1 : 0)
->execute();
$result->closeCursor();
if (!$row) {
throw new TagNotFoundException(
- 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist'
+ 'Tag ("' . $truncatedTagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist'
);
}
}
$beforeUpdate = array_shift($tags);
+ // Length of name column is 64
+ $truncatedNewName = substr($newName, 0, 64);
$afterUpdate = new SystemTag(
$tagId,
- $newName,
+ $truncatedNewName,
$userVisible,
$userAssignable
);
->set('visibility', $query->createParameter('visibility'))
->set('editable', $query->createParameter('editable'))
->where($query->expr()->eq('id', $query->createParameter('tagid')))
- ->setParameter('name', $newName)
+ ->setParameter('name', $truncatedNewName)
->setParameter('visibility', $userVisible ? 1 : 0)
->setParameter('editable', $userAssignable ? 1 : 0)
->setParameter('tagid', $tagId);