Repository navigation
fix(document): 複製したリソースの情報詳細画面で出る未定義変数の警告を解消 - #479
Conversation
複製したリソースは editedby=0 で作られるため編集者のユーザー名が 取得できず、$editedbyname が未定義のまま参照されて警告が出ていた。 作成者・編集者名の変数を空文字で初期化する。 Closes #474 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01715QYq9MrhezVezp8WXJs6
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Repository: modxcms-jp/evolution-jp/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix resolves the warnings while preserving existing display behavior.
Review effort: Lite
Findings: None
What changed in this PR
Fixes undefined-variable warnings on the resource details page for cloned resources.
Changes:
- Initializes
$createdbynameand$editedbynameto empty strings. - Preserves existing display conditions when user data is unavailable.
| File | Description |
|---|---|
manager/actions/document/document_data.static.php |
Adds defaults for creator and editor name variables. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
概要
複製したリソースの情報詳細画面(
a=3)でUndefined variable $editedbynameの PHP 警告が出る不具合を直します。原因
複製したリソースは
editedby = 0で作られます。document_data.static.phpは編集者のユーザー名が取得できたときだけ$editedbynameを代入しているため、該当ユーザーが無いと未定義のまま参照されていました。$createdbynameも同じ書き方で、作成者のユーザーが削除済みの場合に同じ警告が出ます。変更内容
$createdbynameと$editedbynameを、ユーザー名を取得する前に''で初期化する影響範囲
if ($editedbyname != '')の条件どおり「編集日時」の行を出さない(意図した表示のまま)確認手順
index.php?a=3&id=<複製先ID>)を開く1.3.0rc1 を新規インストールしたローカル環境で、修正前は警告が出て、修正後は出ないことを確認しました。
Closes #474
🤖 Generated with Claude Code
https://claude.ai/code/session_01715QYq9MrhezVezp8WXJs6