Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Report: link to custom assets (GLPI 11+/12 asset definitions) leads to "item not found"

オープン 初心者向け
#127 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

問題のリンクは src/Report.php の203行目付近で生成されており、"Connected to" 列で Toolbox::getItemTypeFormURL() が使われています。Issue によると、$item は各行ごとにすでにインスタンス化されています。そのため、行のループで $item がスコープ内にあること、およびカスタムアセットが getFormURL() をオーバーライドしていることを確認してください。IP範囲に "Network ports" の機能を持つカスタムアセットを使って再現します。完了の条件は、カスタムアセットではリンクがアセットのフォームを開き、コンピュータなどのコアのリンクは既存のフォームURLに引き続き解決されることです。

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

説明

Version: addressing 3.3.0, GLPI 12.0.0

Steps to reproduce

  1. Create a custom asset definition with the "Network ports" capacity.
  2. Give an asset of this type a network port with an IP inside a range (e.g. via the reservation form).
  3. Open the range report and click the asset name in the "Connected to" column.

Expected: the asset form opens.
Actual: "The requested item has not been found".

Cause
src/Report.php (line 203) builds the link with
Toolbox::getItemTypeFormURL($line['itemtype']) . '?id=' . …, which derives a file name from the class:

URL
generated /front/customasset/ip_reservierungasset.form.php?id=12
correct /front/asset/asset.form.php?class=IP_Reservierung&id=12

Custom assets override getFormURL(); Toolbox::getItemTypeFormURL() does not know about that.

Fix
$item is already instantiated for the row a few lines above, so:

$row['device'] = self::newCell(
    $label,
    $item::getFormURLWithID((int) $line['on_device']),
);

The result is the same as before for core types (e.g. /front/computer.form.php?id=12).

主要言語
PHP
スター
43
フォーク
24
平均マージ
1時間 4分
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

pluginsGLPI/addressing のほかの issue

pluginsGLPI/addressing の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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