From 878728a5d208c7cd9e57b453ea4d8e9cbbd678b4 Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Mon, 19 Jul 2021 16:23:00 +0200 Subject: [PATCH] fix(x-editable): choice value update crash with 0 value Because of the weak comparison, if we try to update a choice list field with a value of 0, it is considered as a violation. --- src/Action/SetObjectFieldValueAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Action/SetObjectFieldValueAction.php b/src/Action/SetObjectFieldValueAction.php index 058a131707..25911413df 100644 --- a/src/Action/SetObjectFieldValueAction.php +++ b/src/Action/SetObjectFieldValueAction.php @@ -225,7 +225,7 @@ public function __invoke(Request $request): JsonResponse $value = $dataTransformer->reverseTransform($value); } - if (!$value && FieldDescriptionInterface::TYPE_CHOICE === $fieldDescription->getType()) { + if (null === $value && FieldDescriptionInterface::TYPE_CHOICE === $fieldDescription->getType()) { return new JsonResponse(sprintf( 'Edit failed, object with id: %s not found in association: %s.', $originalValue,