From 2dd0eb632d59ea67a3671541e335f85eacd21cba Mon Sep 17 00:00:00 2001 From: David Molineus Date: Tue, 20 Jan 2015 17:28:37 +0100 Subject: [PATCH] Fix setting of bolean values. --- src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php index 9e1e67a..88678b3 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php @@ -322,7 +322,11 @@ abstract class AbstractMapper implements Mapper $default = $this->getDefaultOption($option, $definition); if ($model->$mapping === '1' || $model->$mapping === '') { - if (((bool) $model->$option) !== $default) { + if (((bool) $model->$mapping) !== $default) { + $definition->$setter($model->$mapping); + } + } elseif (is_numeric($default)) { + if ($model->$mapping != $default) { $definition->$setter($model->$mapping); } } elseif ($model->$mapping !== $default) {