Skip to content

Commit

Permalink
Merge pull request #17155 from frappe/mergify/bp/version-13-hotfix/pr…
Browse files Browse the repository at this point in the history
…-17152

fix: JS error in page.js when the is a quote in button translation (backport #17152)
  • Loading branch information
surajshetty3416 committed Jun 13, 2022
2 parents a8ff365 + a4e07a0 commit 3b17f1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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 @@ -505,7 +505,7 @@ frappe.ui.Page = Class.extend({

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);
if (existing_items && existing_items.length > 0) return existing_items;
Expand Down

0 comments on commit 3b17f1e

Please sign in to comment.