Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit fa98466

Browse files
Serialize the errored value as we'd like to catch arrays and other unexpected data types
1 parent db7346c commit fa98466

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Logger/DatabaseLogger.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(EntityManagerInterface $em, $entityClass, EventDispa
3131

3232
public function log($formName, $key, $error, $value = '', $uri = '')
3333
{
34-
if ($this->entityClass == 'Oh\FormErrorLogBundle\Entity\FormErrorLogEntityInterface') {
34+
if ($this->entityClass === 'Oh\FormErrorLogBundle\Entity\FormErrorLogEntityInterface') {
3535
throw new InvalidArgumentException('You need to update your %oh_form_error_log.db.entity.class% parameter to your own class. See the README for help.');
3636
}
3737

@@ -41,7 +41,7 @@ public function log($formName, $key, $error, $value = '', $uri = '')
4141
$entity->setFormName($formName);
4242
$entity->setField($key);
4343
$entity->setError($error);
44-
$entity->setValue($value);
44+
$entity->setValue(serialize($value));
4545
// for BC
4646
if (method_exists($entity, 'setUri')) {
4747
$entity->setUri($uri);
@@ -53,4 +53,4 @@ public function log($formName, $key, $error, $value = '', $uri = '')
5353

5454
$this->em->flush($entity);
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)