ECA content: the condition to compare field values doesn't work correctly with boolean fields
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3506183. -->
Reported by: [jurgenhaas](https://www.drupal.org/user/168924)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When comparing a boolean field (e.g. the field <code>in_draft</code> in webform submissions) with something (usually "0" or "1"), that always fails because <code>\Drupal\eca_content\Plugin\ECA\Condition\EntityFieldValue::getFieldValues</code> always returns an empty value for boolean fields.</p>
<p>The reason for that is that the <code>property</code> is a <code>\Drupal\Core\TypedData\Plugin\DataType\BooleanData</code> and that return a boolean which gets casted to string with this:</p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br></span><span style="color: #007700">if (</span><span style="color: #0000BB">$property </span><span style="color: #007700">instanceof </span><span style="color: #0000BB">PrimitiveInterface</span><span style="color: #007700">) {<br> </span><span style="color: #0000BB">$values</span><span style="color: #007700">[] = (string) </span><span style="color: #0000BB">$property</span><span style="color: #007700">-></span><span style="color: #0000BB">getValue</span><span style="color: #007700">();<br>}<br></span><span style="color: #0000BB">?></span></span></pre></div>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>For boolean data, let's cats to integer first and then cast to string.</p>
issue