Skip to content

Commit

Permalink
Truncate result data 1 smaller for correct max size in db
Browse files Browse the repository at this point in the history
  • Loading branch information
jvangestel committed Dec 3, 2024
1 parent 7d2b228 commit 6bb7f4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tracker/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public function checkTokenCompletion(int $userId): int
$stringObject = new UnicodeString((string)$rawAnswers[$resultField]);
$values['gto_result'] = $stringObject
->normalize() // Normalize characters including whitespaces
->truncate($this->_getResultFieldLength()) // Chunk of text that is too long
->truncate($this->_getResultFieldLength() - 1) // Chunk of text that is too long
->toString();
}
}
Expand Down Expand Up @@ -2081,7 +2081,7 @@ public function setResult(array $answers, $userId): bool
$stringObject = new UnicodeString((string)$answers[$resultField]);
$resultValue = $stringObject
->normalize() // Normalize characters including whitespaces
->truncate($this->_getResultFieldLength()) // Chunk of text that is too long
->truncate($this->_getResultFieldLength() - 1) // Chunk of text that is too long
->toString();

$values = [
Expand Down

0 comments on commit 6bb7f4d

Please sign in to comment.