Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Admin search ignores a settings or permissions item's own link

Open Beginner friendly
#5,254 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active

Research direction

Start in framework/core/js/src/admin/components/GeneralSearchSource.tsx and read lookup() around the settings and permissions result handling; compare it with the per-item link documented in framework/core/js/src/admin/states/GeneralSearchIndex.ts. Use each item's link when present, keeping the existing group and extension routes as fallbacks. Done means selecting either result opens its item link when set; check the relevant search tests or add coverage for settings and permissions.

Written by the indexing model from the issue text.

Description

type/bug
Current Behavior

In the admin search, a setting or permission result always opens the extension's main page, even when the indexed item provides its own link.

GeneralIndexItem documents a per-item link:

// framework/core/js/src/admin/states/GeneralSearchIndex.ts:18-22
/**
 * Optional: The URL to navigate to when this item is selected.
 * The default is to navigate to the extension page.
 */
link?: string;

But GeneralSearchSource.lookup() never reads it. Both settings and permissions results use only the group link or the extension route:

// framework/core/js/src/admin/components/GeneralSearchSource.tsx:126 (settings) and :160 (permissions)
group?.link || (corePage ? app.route(corePage) : app.route('extension', { id: extensionId })),

So an extension with tabbed settings, for example using a page route parameter, can't send a search hit to the tab that holds the setting:

app.generalIndex.for('acme-example').add('settings', [
  {
    id: 'acme-example.moderation.thing',
    label: 'Moderation thing',
    tree: ['Moderation'],
    link: app.route('extension', { id: 'acme-example', page: 'moderation' }), // ignored
  },
]);
Steps to Reproduce
  1. Register a settings index item with a link pointing at a sub-page or tab of an extension, as above.
  2. In the admin, search for the setting's label.
  3. Selecting the result opens the extension's default page, not the link.
Expected Behavior

The item's own link is used when present, and the group link or extension route remains the fallback.

Environment
  • Flarum version: 2.x (2.0.2)
Possible Solution
('link' in setting && setting.link) || group?.link || (corePage ? app.route(corePage) : app.route('extension', { id: extensionId })),

Do the same for permissions. registerSetting options could also accept link, so registry-defined settings can point at a tab.

Additional Context

Found while planning tabbed settings for fof/anti-spam. In the meantime, results land on the first tab, with the tree breadcrumb naming the right one.

Dominant language
PHP
Stars
6.8k
Forks
887
Avg merge
12h 6m
Merged PRs (30d)
127

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flarum/framework

All issues in flarum/framework

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.