Drupal 10: Error on /admin/ai/context/items/add: scheduler_content_moderation_integration module conflict
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3578657. -->
Reported by: [dstorozhuk](https://www.drupal.org/user/1361080)
Related to !94
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>Error encountered when creating AI Context items on fresh installation; workaround available<br>
<strong>Check-in Date: </strong>03/11/2026<br>
<strong>Blocked by: </strong>None<br>
<strong>Additional Collaborators: </strong><br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When following the installation steps from the module's main page and visiting <code>/admin/ai/context/items/add</code> on a fresh Drupal 10 installation, the following error occurs:</p>
<pre><pre>Error: Call to a member function getFieldStorageDefinition() on null in scheduler_content_moderation_integration_scheduler_hide_publish_date() (line 22 of modules/contrib/scheduler_content_moderation_integration/includes/scheduler_hooks.inc).<br>_scheduler_entity_form_alter() (Line: 91)<br>scheduler_form_alter() (Line: 552)</pre></pre><h3>Steps to reproduce</h3>
<ol>
<li>Follow the installation steps from the module page:</li>
</ol>
<pre><div class="codeblock"><code class="language-bash">mkdir my-drupal-site && cd my-drupal-site<br>ddev config --project-type=drupal11 --docroot=web<br>ddev start<br>ddev composer create-project "drupal/recommended-project:^10"<br>ddev composer require drush/drush<br>ddev exec sed -i 's/"minimum-stability": "stable"/"minimum-stability": "dev"/' composer.json<br>ddev composer require drupal/ai_context:dev-1.0.x -W<br>ddev composer require drupal/ai_agents_debugger<br>ddev drush site:install --account-name=admin --account-pass=admin -y<br>ddev drush en ai_context ai_agents_debugger -y<br>ddev launch<ol start="2">
<li>Visit <code>/admin/ai/context/items/add</code></li>
<li>Error appears</li>
</ol>
<h3>Workaround</h3>
<p>Visit <code>/admin/ai/context/settings/items</code> and save the settings (without making any changes). After this, items can be created without error.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>The module likely needs some default configuration to be initialized properly during installation. The settings page save operation initializes this config, which is why the workaround works.</p>
<p>Possible solutions:</p>
<ul>
<li>Ensure required configuration is created during module installation</li>
<li>Add validation/initialization in the entity form to handle missing configuration gracefully</li>
<li>Document the need to configure settings before creating items</li>
<li>
Consider removing:
<pre>$this->container->get('config.factory') <br> ->getEditable('ai_context.ai_context_item_type.default') <br> ->set('third_party_settings.scheduler.publish_enable', FALSE) <br> <br> ->set('third_party_settings.scheduler.unpublish_enable', FALSE) <br> <br> ->save(); </pre></li>
<p>in test setUp() methods</p>
<ul>
<li>tests/src/Functional/AiContextItemCrudTest.php:67</li>
<li> tests/src/Functional/AiContextItemFormTest.php:66</li>
<li> tests/src/Functional/AiContextItemValidationBrowserTest.php:66</li>
</ul>
</ul>
<h3 id="summary-remaining-tasks">Target date or deadline</h3>
<p>ASAP</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Investigate root cause of missing configuration</li>
<li>Implement fix in module installation hooks</li>
<li>Test on both Drupal 11 and Drupal 10</li>
</ul>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[X] AI Assisted Issue<br><br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code<br><br>
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p>
<p>[ ] AI Generated Code<br><br>
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p>
<p>[ ] Vibe Coded<br><br>
This code was generated by an AI and has only been functionally tested.</p>
</code></div></pre>
issue