Skip to content

Fix error display in AJAX pane requests to prevent HTML nesting - #483

Closed
yama wants to merge 3 commits into
mainfrom
claude/modx-manager-edit-lock-conflict-8u0qrv
Closed

yama wants to merge 3 commits into
mainfrom
claude/modx-manager-edit-lock-conflict-8u0qrv

Conversation

@yama

@yama yama commented Sep 29, 2026

Copy link
Copy Markdown
Member

概要

AJAX断片応答(pane request)でエラーが発生した場合、header/footerを含む完全なHTMLが出力されることで、#mainPane内に<html>タグやメニュー・ツリーが入れ子で挿入され、画面崩れとローディング残りが発生していた問題を修正します。

変更内容

  • manager/index.php: pane request時にEVO_PANE_REQUEST定数を定義し、エラーハンドラが断片応答であることを認識できるようにしました
  • manager/includes/error.class.inc.php:
    • EVO_PANE_REQUEST定数の有無で、header/footerの出力を制御
    • pane request時はfooterの代わりにevoRenderPaneFooterExtras()を呼び出し
  • manager/media/style/common/dump_error.tpl:
    • EvoShellが利用可能な場合はEvoShell.navigate()を使用してナビゲーション
    • フォールバックとして従来のtop.main.document.location.hrefを保持

確認手順

  • pane request中にエラーが発生した場合、エラーダイアログが表示され、画面崩れが発生しないことを確認
  • EvoShell環境でのナビゲーション動作を確認
  • 通常のリクエスト時のエラー表示が従来通り動作することを確認

備考

  • EVO_PANE_REQUEST定数はpane request時のみ定義され、エラーハンドラ内で条件分岐の判定に使用されます
  • 既存のisEvoPaneRequest()関数との重複を避けるため、定数として別途定義しています

https://claude.ai/code/session_01FVRJfjddiH9DeArnkyHvEt

dumpError()がheader.inc.php(完全なHTML・メニュー・ツリー)を#mainPane内へ
挿入し、画面崩れと「読み込み中」残りを起こしていた。断片要求では出力を省略し、
通知後の遷移もEvoShell.navigateで行う。

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FVRJfjddiH9DeArnkyHvEt
Copilot AI balanced review requested due to automatic review settings September 29, 2026 12:43
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: modxcms-jp/evolution-jp/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 00c84aaa-44d7-45f9-ae75-37574cc8fe9f

📥 Commits

Reviewing files that changed from the base of the PR and between 8aed88c and 28f4ce8.

📒 Files selected for processing (3)
  • manager/includes/error.class.inc.php
  • manager/index.php
  • manager/media/style/common/dump_error.tpl

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1aa09f6c57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread manager/media/style/common/dump_error.tpl

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

pane判定前のエラーとモーダル内エラーで画面崩れやオーバーレイ残留が発生する。

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

AJAX断片応答時のエラー表示によるHTML入れ子化を防止する変更。

  • pane request識別用定数を追加
  • エラー応答から完全HTMLを除外
  • EvoShell経由のエラー後遷移を追加
File Description
manager/​index.php pane request識別定数を定義
manager/​includes/​error.class.inc.php pane向け断片エラー応答を生成
manager/​media/​style/​common/​dump_error.tpl EvoShellナビゲーションを追加

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread manager/index.php
Comment thread manager/media/style/common/dump_error.tpl
@yama

yama commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

#488 で作り直したため、クローズします。

#483 は dumpError() だけを直していて、実環境(Docker + Playwright)のテストで次の 2 点が残っていました。

  • 権限エラーなど、processor が header/footer を直接読み込む経路は、入れ子のまま
  • アクション確定前のエラー(POST)で、画面が白紙になる(main では正常に表示される)

#488 は、header.inc.php / footer.inc.php の側で、応答ヘッダー X-Evo-Pane を見て出力を抑えるので、これらもまとめて直ります(テスト結果: main 11/16、#483 12/16、#488 16/16)。

@yama yama closed this Oct 10, 2026
@yama
yama deleted the claude/modx-manager-edit-lock-conflict-8u0qrv branch October 10, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants