[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 摘要。