-
Notifications
You must be signed in to change notification settings - Fork 8
Update Installation.php #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
retrieve the store from the session for the current order, to address an issue in the admin where the region is passed incorrectly to admin orders
WalkthroughThe changes update the Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
Block/Adminhtml/Order/Create/Installation.php(1 hunks)
🔇 Additional comments (3)
Block/Adminhtml/Order/Create/Installation.php (3)
18-23: Session Quote dependency introduction — good callUsing the backend session quote as a dependency is the right source of truth for admin order creation and avoids relying on mutable POST data.
33-35: Correct source for store context in admin create-order flowReturning the store ID from the session quote is the right fix and reduces risk of incorrect/forged POST values, addressing the region mismatch in admin orders.
33-35: No chaining usages of getCurrentStore() detectedAll discovered calls to getCurrentStore() simply treat its return value as an integer store ID—there are no downstream method chains expecting a Store object:
- view/adminhtml/templates/installation.phtml:
$currentStoreId = $block->getCurrentStore();
Passed directly to$viewModel->isExtendEnabled($currentStoreId)- Block/Adminhtml/Order/View/Installation.php also defines getCurrentStore() returning an int and is not chained.
Since no code or template chains methods on getCurrentStore(), it’s safe that this method now returns an ID.
Updated constructor based on feedback from AI : Adding a required constructor arg can break 3rd‑party subclasses/overrides. Magento convention is to add it as optional with an ObjectManager fallback to preserve BC
retrieve the store from the session for the current order, to address an issue in the admin where the region is passed incorrectly to admin orders
Summary by CodeRabbit