Skip to content

fix form showfield edit error#27

Closed
Seevil wants to merge 1 commit into
pbootcmspro:masterfrom
Seevil:master
Closed

fix form showfield edit error#27
Seevil wants to merge 1 commit into
pbootcmspro:masterfrom
Seevil:master

Conversation

@Seevil

@Seevil Seevil commented Aug 23, 2025

Copy link
Copy Markdown

修复 后台点击 自定义表单>编辑字段
路径'/admin.php?p=/Form/index/fcode/1/action/showfield' 报错 :程序运行异常: Undefined constant "PAGE"
wechat_2025-08-23_092919_217

修复 后台点击 自定义表单>编辑字段 
路径'/admin.php?p=/Form/index/fcode/1/action/showfield' 报错 :程序运行异常: Undefined constant "PAGE"
@pbootcmspro pbootcmspro force-pushed the master branch 2 times, most recently from 98c273f to e53beb4 Compare June 17, 2026 17:06
@pbootcmspro pbootcmspro added the needs review Pull request is ready for maintainer review label Jun 27, 2026
@pbootcmspro pbootcmspro self-assigned this Jun 27, 2026
@pbootcmspro

Copy link
Copy Markdown
Owner

修复 #45

@pbootcmspro

Copy link
Copy Markdown
Owner

当前 PR 还不能 /lgtm,原因如下:

  • 这个问题的根因在模板编译器:[num] 在编译时如果检测到 PAGE 已定义,会被编译成硬编码 PAGE-1;后续在无分页常量的 showfield 页面执行编译缓存时,仍会触发 Undefined constant "PAGE"
  • 本 PR 只是把模板里的 {foreach $fields(key,value)} / [num] 改成 {foreach $fields(key,value,num2)} / [num2],但解析器对任意序号变量都会走同样逻辑,因此 [num2] 仍会被编译成硬编码 PAGE-1,没有阻断根因。

已用最小模板验证:origin [num] 和本 PR [num2] 在无 PAGE 常量执行时都会报 Undefined constant "PAGE";需要在 core/view/Parser.php 的序号解析逻辑中做运行时 defined("PAGE") 判断后再复核。

@pbootcmspro pbootcmspro added confirmed Issue has been confirmed or accepted and removed needs review Pull request is ready for maintainer review labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

confirmed Issue has been confirmed or accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants