AssertionError: Cannot load the "key" entity with NULL ID.
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3594215. --> Reported by: [beltofte](https://www.drupal.org/user/151799) Related to !71 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Installed the new 2.3.0-alpha8 version on a fresh D10 installation and on /admin/config and /admin/reports is it throwing the following error:</p> <p><code>AssertionError: Cannot load the "key" entity with NULL ID. in assert() (line 261 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).</code></p> <p>No key entity has yet been created in the Key module and configured in the DeepL providers in TMGMT. The alpha8 version contains a change in getTranslator() where it does a strict comparison on the $key_id:</p> <pre>if ($key_id !== '') {<br><br>}</pre><p>This statement let null, 0, '0' etc. pass as they are not empty strings and then we have the error and no option to configure the missing key from the UI.</p> <p>UPDATE: The issue also exist twice in DeeplMultilingualGlossaryApi.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Prepare a fresh D10/D11 installation</li> <li>Install tmgmt_deepl 2.3.0-alpha8 and other required modules.</li> <li>Navigate to /admin/config or /admin/reports</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Change the strict comparison from:</p> <pre>if ($key_id !== '') {<br><br>}</pre><p>to </p> <pre>if (is_string($key_id) &amp;&amp; $key_id !== '') {<br><br>}</pre>
issue