Both node and media forms break when loaded under non-standard routes
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3085072. -->
Reported by: [jorgegc](https://www.drupal.org/user/834154)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<ul>
<li>The "Drupal\node\NodeForm" form is not altered when loaded under a route whose path does not contain the strings "node", "add" or "edit"</li>
<li>The "Drupal\media\MediaForm" form is not altered when loaded under a route whose path does not contain the strings "media", "add" or "edit"</li>
<li>The module relies on the URL path to determine whether the Node/Media form needs to be altered</li>
</ul>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Remove <em>scheduled_publish_is_supported_edit_form</em> helper function</li>
<li>Update <em>scheduled_publish_form_alter</em> to check whether:
<ul>
<li>The form implements ContentEntityFormInterface</li>
<li>The form entity is supported (Node or Media)</li>
<li>The form entity has Scheduled Publish fields and they are present in the form</li>
</ul>
</li>
</ul>
issue