Add ternary operator to fix bug related with empty key#18565
Conversation
WalkthroughAdded handling for taxons with empty names: template now preserves Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant AdminUI as Admin UI
participant Template as main_taxon template
participant Product as Product Data
participant Taxon as Taxon Data
participant Behat as Behat Context
Note over Behat,Taxon: Setup step may set taxon name to empty
Behat->>Taxon: set translation name = ""
Taxon-->>Product: product.mainTaxon (fullname, name)
AdminUI->>Product: request product list
Product->>Template: render main_taxon field with data.fullname & data.name
alt data.name is truthy
Template->>Template: categories = fullname.replace(name, '')
Template-->>AdminUI: render name and tooltip with categories
else data.name is empty/false
Template->>Template: categories = fullname
Template-->>AdminUI: render (empty) name and tooltip with fullname
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
🔇 Additional comments (2)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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 |
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
I reproduced error when chose nl_NL and ran command bin/console sylius:install. Bug was caused lack translations for taxons.
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.