Skip to content

Fix view lookup after renderText/renderWith (#1961)#1991

Merged
bpamiri merged 1 commit intodevelopfrom
peter/1961-fix-render-view-lookup
Mar 17, 2026
Merged

Fix view lookup after renderText/renderWith (#1961)#1991
bpamiri merged 1 commit intodevelopfrom
peter/1961-fix-render-view-lookup

Conversation

@bpamiri
Copy link
Collaborator

@bpamiri bpamiri commented Mar 16, 2026

Summary

  • Wrap the $invoke call in $callAction with try-catch so action errors re-throw with their original type instead of falling through to the auto-render block and producing a misleading ViewNotFound error
  • Add $renderWithAttempted() guard: renderWith() now sets a flag at entry so the auto-render block is skipped even if renderWith() fails mid-execution (before reaching renderText())
  • Add 4 tests covering: renderText skips view lookup, renderNothing skips view lookup, action errors preserve original type, and renderWithAttempted flag is respected

Test plan

  • Verify renderText("hello") in an action does NOT trigger view file lookup
  • Verify renderNothing() in an action does NOT trigger view file lookup
  • Verify action errors throw with original type (not Wheels.ViewNotFound)
  • Verify renderWith() failure does not fall through to auto-render block
  • Run full test suite to confirm no regressions

Closes #1961

🤖 Generated with Claude Code

Wrap the action $invoke call in try-catch so errors in controller
actions are re-thrown directly instead of falling through to the
auto-render block (which produces a misleading ViewNotFound error).

Add $renderWithAttempted() guard so the auto-render block is skipped
when renderWith() was called but failed before completing. The flag
is set at the top of renderWith() before any serialization work.

Tests verify: renderText in action skips view lookup, renderNothing
in action skips view lookup, action errors re-throw with original
type, and the renderWithAttempted flag is respected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Wheels Test Matrix

Engine MySQL PostgreSQL SQL Server H2 Oracle SQLite
lucee5 ❌ 2 ❌ 2 ❌ 2 ❌ 2 ❌ 2 ❌ 2
lucee6 ❌ 2 ❌ 2 ❌ 2 ❌ 2 ❌ 2 ❌ 2
lucee7 ❌ 2 ❌ 2 ❌ 2 ❌ 2 ❌ 2 ❌ 2
adobe2018 ❌ 2 ❌ 2 ❌ 2 -- ❌ 2 --
adobe2021 ❌ 2 ❌ 2 ❌ 2 -- ❌ 2 ❌ 2
adobe2023 ❌ 2 ❌ 2 ❌ 2 -- ❌ 2 ❌ 2
adobe2025 ❌ 2 ❌ 2 ❌ 2 -- ❌ 2 ❌ 2
boxlang ❌ 2 ❌ 2 ❌ 2 -- ❌ 2 ❌ 2

Results for commit c5eee64.

@github-actions
Copy link
Contributor

Wheels Test Results

    42 files  ±  0   3 906 suites  ±0   25m 21s ⏱️ -15s
79 680 tests +168  79 208 ✅ +84  388 💤 ±0  0 ❌ ±0  84 🔥 +84 
82 326 runs  +168  81 854 ✅ +84  388 💤 ±0  0 ❌ ±0  84 🔥 +84 

For more details on these errors, see this check.

Results for commit 05e08f6. ± Comparison against base commit e57ecf8.

@bpamiri bpamiri merged commit 22e3544 into develop Mar 17, 2026
3 of 12 checks passed
@bpamiri bpamiri deleted the peter/1961-fix-render-view-lookup branch March 17, 2026 22:29
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.

Fix renderText/renderWith view file lookup bug

1 participant