Skip to content

[#498] Fix missing Response import and redirect return in templates#499

Merged
armanist merged 1 commit intosoftberg:masterfrom
armanist:issue/498-template-response-fixes
May 4, 2026
Merged

[#498] Fix missing Response import and redirect return in templates#499
armanist merged 1 commit intosoftberg:masterfrom
armanist:issue/498-template-response-fixes

Conversation

@armanist
Copy link
Copy Markdown
Member

@armanist armanist commented May 4, 2026

Closes #498

Summary by CodeRabbit

  • Bug Fixes
    • Fixed HTTP response handling in controller templates to ensure all action methods properly return responses
    • Updated response class imports and references across controller templates to align with correct response patterns

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a248faf-6619-4c36-b8e9-e9dfd67b7382

📥 Commits

Reviewing files that changed from the base of the PR and between 28a6bd9 and 2e68c09.

📒 Files selected for processing (2)
  • src/Module/Templates/DemoWeb/src/Controllers/CommentController.php.tpl
  • src/Module/Templates/Toolkit/src/Controllers/EmailsController.php.tpl

📝 Walkthrough

Walkthrough

This PR fixes two template regressions in module controllers. CommentController.php.tpl adds a missing Quantum\Http\Response import to resolve its declared return types. EmailsController.php.tpl updates the delete action to explicitly return the redirect response instead of calling it without returning.

Changes

Controller Template Response Fixes

Layer / File(s) Summary
Import Resolution
src/Module/Templates/DemoWeb/src/Controllers/CommentController.php.tpl
Adds use Quantum\Http\Response; so the controller's Response return type declarations resolve correctly.
Return Statement Fix
src/Module/Templates/Toolkit/src/Controllers/EmailsController.php.tpl
Updates the delete method to return redirect(...) instead of calling redirect(...) without returning, ensuring the method yields a Response.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • andrey-smaelov

Poem

🐰 Templates now import their Response with care,
And delete redirects with a proper return to share,
No missing paths nor forgotten types in sight,
The controllers align, regressions fixed right! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses two of three identified issues: adding Response import to CommentController and returning redirect in EmailsController. However, the Password middleware's validateRequest() response return is not addressed. Implement the fix for DemoWeb password middleware template to return $errorResponse when validateRequest() fails, as specified in issue #498.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main changes: fixing missing Response imports and redirect returns in template files.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the three affected template files identified in issue #498; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.87%. Comparing base (28a6bd9) to head (2e68c09).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #499   +/-   ##
=========================================
  Coverage     90.87%   90.87%           
  Complexity     2926     2926           
=========================================
  Files           255      255           
  Lines          7703     7703           
=========================================
  Hits           7000     7000           
  Misses          703      703           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@armanist armanist added the bug Something isn't working label May 4, 2026
@armanist armanist added this to the 3.0.0 milestone May 4, 2026
@armanist armanist merged commit a21747f into softberg:master May 4, 2026
7 checks passed
@armanist armanist deleted the issue/498-template-response-fixes branch May 4, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix template regressions: missing Response return/import in controllers and middleware

1 participant