[upstream] Can't select media from library in Canvas when Gin is installed
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3531415. --> Reported by: [mglaman](https://www.drupal.org/user/2416470) Related to !171 >>> <h3 id="overview">Overview</h3> <p>You can't use the media library in Canvas when Gin is installed. Such as adding a meta image in the built-in metatag image field. You get</p> <pre>"call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "gin_form_after_build" not found or invalid function name"</pre><p>That's because the theme switches from gin to xb_stark. It's due to <code>$use_sticky_action_buttons</code> causing the form to have callbacks to Gin, but Gin isn't loaded.</p> <h3>Video of problem</h3> <p><video width="960" height="540" src="/files/issues/2025-10-06/Screen%20Recording%202025-10-06%20at%2010.13.41%E2%80%AFAM.mov"></video></p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>Implement hook_gin_ignore_sticky_form_actions and ignore the Canvas page form</p> <pre>/**<br> * Implements hook_gin_ignore_sticky_form_actions().<br> */<br>function haas_content_gin_ignore_sticky_form_actions() {<br>&nbsp; return ['xb_page_form'];<br>}</pre><h3>Video with patch applied</h3> <p><video width="960" height="540" src="/files/issues/2025-10-06/Screen%20Recording%202025-10-06%20at%2010.14.57%E2%80%AFAM.mov"></video></p> <p>In the future something calculated at runtime will be needed to ignore any form in a Canvas API call</p> <h3 id="ui-changes">User interface changes</h3> > Related issue: [Issue #3492722](https://www.drupal.org/node/3492722) > Related issue: [Issue #3539391](https://www.drupal.org/node/3539391) > Related issue: [Issue #3488050](https://www.drupal.org/node/3488050)
issue