Fix Won/Lost modal failure and broken dashboard chart#2491#2495
Open
willestevam wants to merge 2 commits into
Open
Fix Won/Lost modal failure and broken dashboard chart#2491#2495willestevam wants to merge 2 commits into
willestevam wants to merge 2 commits into
Conversation
…plicate-name translation
Replace raw `{!! trans(...) !!}` output with `@json(trans(...))` in pipeline
create and edit views. When translations (e.g. pt_BR) contain double quotes
inside the string — such as 'O campo "Nome" não pode ser duplicado' — the
raw output broke the surrounding JavaScript string literal, causing an
`Uncaught SyntaxError: Unexpected identifier` in the browser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a new pipeline is created, the code column in the lead_pipeline_stages table is populated with a slug of the stage name. This causes the "Won/Lost" modal to fail when a lead is completed and breaks the "Won/Lost" chart on the dashboard.
Solution
Preserve English stage codes when locale is non-English. Use slugify(element.code ? element.code : element.name) to mirror edit.blade.php behaviour. Prevents "new"/"won"/"lost" being saved as translated slugs on pipeline creation
Affected files
packages/Webkul/Admin/src/Resources/views/settings/pipelines/create.blade.phppackages/Webkul/Admin/src/Resources/views/settings/pipelines/edit.blade.php