Errors when no libraries are attached
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3557415. --> Reported by: [jkingsnorth](https://www.drupal.org/user/2659819) Related to !135 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When editing an existing paragraph, the '['#attached']['library']' might be empty, leading to PHP warnings, which in turn leads to Drupal ajax errors.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>- Create a piece of content with paragraphs.<br> - Edit an existing paragraph.</p> <p><code>Warning: Undefined array key "library" in /app/web/modules/contrib/frontend_editing/frontend_editing.module on line 1087 Warning: foreach() argument must be of type array|object, null given in /app/web/modules/contrib/frontend_editing/frontend_editing.module on line 1087</code></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Check that libraries are not empty.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>None</p> <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