[IP Reservation Modal] Submit button ("+ Add") does not trigger form submission (button.form is null)

未關閉
#131 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
半天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
javascript, php
領域
frontend

研究方向

The reproduction starts at Tools > IP Addressing, then opens the IP reservation modal from an IP network report, so the modal markup is the place to look; the payload does not name a file. Check whether the "+ Add" submit button is rendered outside the form element that holds the asset fields, since the reporter found btn.form is null. Done means clicking Add sends the POST and creates the reservation, and btn.form returns the form.

由索引模型根據 Issue 內容生成。

描述

Code of Conduct
  • I agree to follow this project's Code of Conduct
Is there an existing issue for this?
  • I have searched the existing issues
GLPI Version

11.0.8

Plugin version

3.2.15

Bug description
Description

When attempting to reserve an IP address from the IP Addressing report modal (IP reservation), clicking the "+ Add" (+ Añadir) button does nothing. No HTTP request (POST/GET) is sent over the network, and no JavaScript errors are printed in the console.

Steps to Reproduce
  1. Go to Tools > IP Addressing and open an IP network report.
  2. Click on a free IP to open the IP reservation modal dialog.
  3. Fill in the required fields (Asset Name, Type, etc.). The validation successfully passes ("Ok you can use this name").
  4. Click on the "+ Add" button.
Expected Behavior

A POST request should be submitted to create the reservation/item, or an AJAX request should be dispatched.

Actual Behavior

Nothing happens. The Network tab records 0 requests upon clicking the button.

Root Cause Analysis

Inspecting the DOM and running tests via DevTools console confirms that the button is orphaned from the form:

const btn = Array.from(document.querySelectorAll('button')).find(b => b.textContent.includes('Añadir') || b.textContent.includes('Add'));
console.log(btn.type); // "submit"
console.log(btn.form); // null

### Relevant log output

```shell

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?
Image Image Image
主要語言
PHP
星號
43
分支
24
平均合併
6 小時 30 分鐘
30 天內合併 PR
1

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

pluginsGLPI/addressing 的其他 Issue

查看 pluginsGLPI/addressing 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。