# النقر على الرئيسية من لوحة التحكم يؤدي إلى خطأ

**URL:** <https://meta.discourse.org/t/clicking-home-from-admin-panel-results-in-error/286000>\
**Category:** Bug\
**Created:** [19 نوفمبر 2023، 5:37م UTC](https://meta.discourse.org/t/clicking-home-from-admin-panel-results-in-error/286000 "2023-11-19T17:37:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [19 نوفمبر 2023، 10:16م UTC](https://meta.discourse.org/t/clicking-home-from-admin-panel-results-in-error/286000/5 "2023-11-19T22:16:37Z")

</div>

نعم، يمكنني تأكيد ذلك أيضًا.

مقدم هنا:

> <https://github.com/discourse/discourse/pull/24373>
>
> We want / to display one of our discovery routes/controllers, but we don't want …to register it as \`discovery.index\` because that would break themes/plugins which check the route name. Previously, this was handled using a variety of approaches throughout the codebase (in discourse-location, discourse-url and mapping-router). But even then, it didn't work consistently. For example, if you used an Ember method like \`router.transitionTo("/")\`, an empty \`discovery.index\` page would be rendered.
> 
> This commit switches up the approach. \`discovery.index\` is now defined as a real route, and redirects to the desired homepage. To preserve the \`/\` as a 'vanity url', we patch the method on the router responsible for persisting URLs to the Ember Router and the browser. The patch identifies a relevant transition by looking for a magic query parameter.
> 
> In an ideal world, we wouldn't be patching the router at all. But at least with this commit, the workaround is all in one place, and works consistently for all navigation methods.

ويحدث الخطأ هنا:

> <https://github.com/discourse/discourse/blob/5ad3e26cf6b4c1c4c745249b901f5ada72da9842/app/assets/javascripts/discourse/app/routes/discovery-index.js#L12>

> **يبدو أن حقل \`url\` مفقود**
>
> ![image](https://global.discourse-cdn.com/meta/original/4X/c/f/1/cf18f337673e07e707486660751502def538182d.png)

ويبدو أنه يحدث فقط عندما يكون `urlMethod` هو `replaceURL`.

---

_[View the full topic](https://meta.discourse.org/t/clicking-home-from-admin-panel-results-in-error/286000)._
