flarum / flarum/issue-archive

Default route cannot be set to something unknown to app.routes

Open
#290 12 comments 0 reactions 0 assignees View on GitHub
type/feature
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The Frontend logic disallows setting a default_route value that is unknown to the `app` as it finds the path within `app.routes`. See:

```js
const defaultRoute = app.forum.attribute('defaultRoute');
let defaultAction = 'index';

for (const i in app.routes) {
if (app.routes[i].path === defaultRoute) defaultAction = i;
}

app.routes[defaultAction].path = '/';
```

It would be great to allow users and extensions to override the value so it actually works, eg pointing to a specific discussion or tag.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the frontend logic that reads `defaultRoute` and searches `app.routes`, using the shown route initialization as the entry point. Determine how an unknown route can be preserved or overridden by users and extensions, then verify that `default_route` can target a specific discussion or tag instead of only a registered route.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.