Skip to content
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

fix: JS error in page.js when the is a quote in button translation #17152

Merged
merged 2 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cypress/integration/custom_buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const test_button_names = [
"Porcupine Tree (the GOAT)",
"AC / DC",
`Electronic Dance "music"`,
"l'imperatrice",
];

const add_button = (label, group = "TestGroup") => {
Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/ui/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ frappe.ui.Page = class Page {

if (!label || !parent) return false;

const item_selector = `${selector}[data-label='${encodeURIComponent(label)}']`;
const item_selector = `${selector}[data-label="${encodeURIComponent(label)}"]`;

const existing_items = $(parent).find(item_selector);
return existing_items?.length > 0 && existing_items;
Expand Down