[3.x] Tags: store an order for secondary tags

Open
#5,456 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
laravel, php
Domain
api, backend

Research direction

Read the tag ordering implementation for position, POST /api/tags/order, and the admin Tags page, along with the migration that assigns existing tag positions. The issue leaves two product decisions open: where manual ordering applies and how child tags count toward required tag limits. Once those decisions are made, verify secondary tags can be reordered and existing order matches the admin's current name order.

Written by the indexing model from the issue text.

Description

needs-discussion type/feature

Secondary tags have no order: the admin lists them by name, and the forum's Tags page and sidebar by number of discussions. This was a deliberate choice in #1549 (so the sidebar can show the three most-used secondary tags). The fix proposed for #5236 disables dragging within the secondary list instead of accepting an order and discarding it.

For 3.0, once extensions identify a tag's kind through isPrimary() / isSecondary() instead of position (#5455), position can mean the order within a tag's own list for every kind.

To do
  • position orders secondary tags too. Secondary tags no longer have a null position, which is a breaking change for anything still checking it.
  • POST /api/tags/order accepts the secondary list as well, and the admin Tags page lets it be reordered again.
  • A migration gives existing secondary tags positions, by name, matching what the admin shows today.
To decide
  • Where the manual order applies: the admin list, the forum Tags page cloud, and the sidebar's "most-used three". Options: always manual; manual with the sidebar keeping its most-used choice; or a setting.
  • Whether the required tag counts should treat child tags as primary, since "primary" now means the whole primary tree. If they do, the primary limits may need separate settings for children.

Related: #3640 and #4065 cover the existing child-tag counting inconsistency.

Dominant language
PHP
Stars
6.8k
Forks
891
Avg merge
1d 10h
Merged PRs (30d)
209

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.