Repository navigation
fix: open products with a price for editing - #38
Conversation
The price repeater's item label called Currency::from() on the row's currency, which is already the enum once loaded from a saved Price, so the edit page crashed for any product with a price. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
|



Problem
Editing a product with a price crashes:
Currency::from(): Argument #1 ($value) must be of type string|int, Modules\Billing\Enums\Currency givenPricecastscurrencyto the enum, so a saved row's state holds aCurrency, while the repeater's item label passed it toCurrency::from(). Unsaved rows hold a string.Fix
Move the label into
ProductForm::priceLabel(), which accepts either form, askindIs()already does forPlanKind.Tests
test_a_plan_with_a_price_opens_for_editingfailed with the reported error before the fix.🤖 Generated with Claude Code
Summary by CodeRabbit