Primiry sub tag != secondary tags

オープン
#4,065 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php

調査の方向性

タグがセカンダリかどうかを確認するタグ拡張のチェックから始め、issue で説明されている position と parent_id の条件に焦点を当てます。記載されている設定とディスカッション作成の手順を再現し、その後、プライマリタグにプライマリサブタグを付けた場合に権限エラーなしで受け入れられることと、選択した親との関係が正しく処理されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

breaking-changes type/feature
Current Behavior

If I want people to create discussions using at minimum one primary tag and at minimum one primary subtag, it doesn't work properly because the primary subtag doesn't equal the secondary tag.

It gives an error about lack of permission.

Steps to Reproduce
  1. Create a primary tag and put a primary subtag in it
  2. In the settings specify minimum primary tags 1 and minimum secondary tags 1
  3. Try to create a discussion by specifying one primary tag and a primary subtag
  4. It will give a permissions error
Expected Behavior

When you create a discussion using at minimum one primary tag and one primary sub tag the discussion should create and not give permission errors

Screenshots

No response

Environment
  • Flarum version: 1.8.7
  • Webserver: nginx/1.18
  • Hosting environment: vps
  • PHP version: 8.3.8
  • Browser: Firefox 131
Output of php flarum info

No response

Possible Solution

After reviewing the open-source code of the tag extension, I concluded that the check for whether a tag is secondary is done through "tags.position == null".
However, primary subtags have a position, and to fix this, we need to use the following check: "tags.position == null || tags.parent_id != null".
This way, primary subtags will also be considered as secondary tags, as they currently should be.
I also believe we need to check if "tags.parent_id != null" and if the parent of this tag is included in the selected tags.

Additional Context

No response

主要言語
PHP
スター
6.8k
フォーク
891
平均マージ
1日 10時間
マージ済み PR(30日)
209

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

flarum/framework のほかの issue

flarum/framework の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。