SetData action check for if a field exists may fail with false positives
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3421270. --> Reported by: [luke.leber](https://www.drupal.org/user/3509746) Related to !3 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The <code>SetData</code> action access check uses the <code>WebformSubmission::getElementData</code> method to determine if an element exists. Some element's values may be null.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Set up a webform with a Value element.</li> <li>Create a new ECA model that creates a new submission and attempts to set the Value element.</li> <li>Notice that access will be denied.</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Use <code>WebformSubmission::getWebform()-&gt;getElement()</code> instead to check if an element exists.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ol> <li>Confirm the issue exists.</li> <li>Open a MR.</li> <li>Review.</li> <li>Merge.</li> </ol> <h3 id="summary-ui-changes">User interface changes</h3> <p>None</p> <h3 id="summary-api-changes">API changes</h3> <p>None</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None</p>
issue