Merge pull request #17152 from FHenry/dev_fix_quote_in_button_name

fix: JS error in page.js when the is a quote in button translation
This commit is contained in:
Suraj Shetty 2022-06-13 08:07:41 +05:30 committed by GitHub
commit 4dc8d0fb44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -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") => {

View file

@ -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;