Block layout warning is displayed even when a theme has no blocks enabled
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3571598. -->
Reported by: [mradcliffe](https://www.drupal.org/user/157079)
Related to !558
>>>
<h3 id="overview">Overview</h3>
<p>If a user checks the "Use Drupal Canvas for page templates in this theme." checkbox in a theme, saves, and then later unchecks the checkbox and saves, then the Block layout continues to display the warning: "This form currently has no effect because the theme has been configured to use Drupal Canvas for managing the block layout."</p>
<p>This is because CanvasBlockListController returns all page regions for the theme regardless of the status</p>
<p>My expectation is that if I uncheck the checkbox, then I would not get the warning.</p>
<p>The quickest way to reproduce this is to check the checkbox on the theme settings page for the admin theme, save, uncheck, save, and then visit Block Layout.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>Only load page regions that are enabled to check whether to display the warning message:</p>
<p>Instead of </p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">-></span><span style="color: #0000BB">loadByProperties</span><span style="color: #007700">([</span><span style="color: #DD0000">'theme' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$theme</span><span style="color: #007700">]);<br></span><span style="color: #0000BB">?></span></span></pre></div>
<p>Replace with</p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">-></span><span style="color: #0000BB">loadByProperties</span><span style="color: #007700">([</span><span style="color: #DD0000">'theme' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$theme</span><span style="color: #007700">, </span><span style="color: #DD0000">'status' </span><span style="color: #007700">=> </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">]);<br></span><span style="color: #0000BB">?></span></span></pre></div>
<h3 id="ui-changes">User interface changes</h3>
<p>The warning on the Block Layout page is displayed only when a theme has page regions enabled.</p>
issue