Tags search criterion returns items of other itemtypes that share the same ID
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 62/100
調査の方向性
The bug is in the search option for tags, built in plugin_tag_getAddSearchOptionsNew(). Compare its joinparams with the regular join, since the generated subquery keeps only condition and drops jointype and specific_itemtype. Reproduce with a tag on a Project and a ProjectTask that share an ID, then check that a 'Tags is' search on projects excludes the project. Done when the search returns only items of the searched itemtype and 'is not' behaves correctly.
索引モデルが issue の本文から書いたものです。
説明
GLPI 11.0.11, Tag 2.14.8.
Searching projects with "Tags is ASYS" returns project 80, which only has the tag DNS. Project task 80 has the tag ASYS.
Since use_subquery is set for GLPI >= 10.0.19, the criterion is built as a subquery by Glpi\Search\Provider\SQLProvider. The subquery only keeps joinparams['condition'] of the glpi_plugin_tag_tagitems join and ignores jointype => itemtype_item / specific_itemtype, so there is no filter on itemtype:
`glpi_projects`.`id` IN (SELECT `items_id` FROM `glpi_plugin_tag_tagitems` WHERE true AND `plugin_tag_tags_id` = '111')
Any item of any type with the same ID and the tag matches. With "is not", the item is wrongly excluded. It happens on every itemtype as soon as a tag is used on more than one type (tickets, changes, computers...). The Tags column in the results is correct, the regular LEFT JOIN has the itemtype condition.
Steps to reproduce:
- Allow a tag on Project and ProjectTask.
- Put the tag on a project task whose ID is also the ID of an untagged project.
- Search projects with "Tags is ": the project is returned.
Adding the itemtype as a join condition in plugin_tag_getAddSearchOptionsNew() fixes it, since the subquery keeps condition:
'jointype' => 'itemtype_item',
'specific_itemtype' => $itemtype,
'condition' => ['NEWTABLE.itemtype' => $itemtype],
We run this patch locally. The core subquery could also handle itemtype_item itself.
- 主要言語
- PHP
- スター
- 30
- フォーク
- 26
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pluginsGLPI/tag のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
pluginsGLPI/tag#395 ·
pluginsGLPI/tag の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
pluginsGLPI/carbon#396 ·
-
[BUG] Bundle products lose their price in RSS feeds: getPrices() was removed対応中かも @pcvelz が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
OpenMage/magento-lts#5869 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
modelcontextprotocol/php-sdk#746 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
OpenGIS/waymark-wp#82 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信