Fix an error on clicking the "Edit this panel" button under the Welcome to your administrative dashboard message
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3124516. -->
Reported by: [Squiggles](https://www.drupal.org/user/189404)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<blockquote><p>Hi,</p>
<p>I came across a link problem in line 69 of TotalControlDashboard.php</p>
<p>if you go do this part:</p>
<p>"Welcome to your administrative dashboard. Edit this panel to add more blocks here, or configure those provided by default.", and click the "Edit this panel" button, I end up with a 404, because the folder name is not included in the address. Thanks
</p></blockquote>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<blockquote><p>
<strong>Given</strong> that the <strong>Total Control</strong> module was installed in a standard <strong>Drupal</strong><br>
<strong>But</strong> the location of the site was a sub folder<br>
<strong>And</strong> not pointed at directly by a domain name<br>
<strong>When</strong> navigating to <code>"admin/dashboard"</code><br>
<strong>Then</strong> the <code>"Welcome to your administrative dashboard. Edit this panel to add more blocks here, or configure those provided by default."</code> text will show up<br>
<a href="https://www.drupal.org/files/issues/2021-10-04/Dashboard%20_%20dev%20.png"><img src="https://www.drupal.org/files/issues/2021-10-04/Dashboard%20_%20dev%20.png" alt="Total Control Dashboard"></a></p>
<p> <strong>Clicking</strong> on <code>"Edit this panel"</code> link<br>
<strong>Then</strong> the following error will show up</p>
<pre>Not Found<br>The requested URL was not found on this server.<br>Apache/2.4.46 (Ubuntu) Server at localhost Port 80</pre></blockquote>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Use the <strong>The Origin URL:</strong> Origin URL (scheme and HTTP host) of the site. <strong>No language prefix.</strong><br>
<pre> // Until #1088112: Introduce a token to get site's base URL is<br> // committed,<br> // https://www.drupal.org/project/drupal/issues/1088112<br> // let's use a custom token. Let's call it: [site:origin-url].<br> // No language prefix in the url.<br> // -----------------------------------------------------------------<br> /** @var \Symfony\Component\HttpFoundation\Request $origin_url */<br> $origin_url = \Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBaseUrl();</pre></li>
<li>Add an automated functional test to check on Clicking on Edit this panel to add more blocks.</li>
</ul>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>✅ File an issue about this project</li>
<li>✅ Fix with the <strong>The Origin URL:</strong> before the local link</li>
<li>✅ Testing to ensure no regression</li>
<li>✅ Automated unit/functional testing coverage<br><br>
<table class="pift-history sticky-enabled tableheader-processed sticky-table">
<tbody>
<tr>
<td class="active">4 Oct 2021 at 23:09 EEST</td>
<td class="active">
<ul class="pift-ci-tests">
<li class="pift-ci-complete pift-ci-pass pift-ci-issue"><a href="https://www.drupal.org/pift-ci-job/2197625" class="test active">PHP 7.4 & MySQL 8, D9.2.0 2 pass</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
</li>
<li>❌ Developer Documentation support on feature change/addition</li>
<li>❌ User Guide Documentation support on feature change/addition</li>
<li>✅ Code review from 1 team member</li>
<li>✅ Full testing and approval</li>
<li>✅ Credit contributors</li>
<li>✅ Review with the product owner</li>
<li>✅ Release <strong><a href="https://www.drupal.org/project/total_control/releases/3.0.2">total_control-3.0.2</a></strong></li>
</ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<ul>
<li>N/A</li>
</ul>
<h3 id="summary-api-changes">API changes</h3>
<ul>
<li>N/A</li>
</ul>
<h3 id="summary-data-model-changes">Data model changes</h3>
<ul>
<li>N/A</li>
</ul>
issue
GitLab AI Context
Project: project/total_control
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/total_control/-/raw/3.0.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/total_control
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD