Skip to content

Commit

Permalink
fix: avoid internal arrays in get_all_docs (backport frappe#20950) (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed May 10, 2023
1 parent 8b0c1f8 commit 43b051f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/form/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ frappe.ui.form.save = function (frm, action, callback, btn) {

const is_empty_row = function(cells) {
for (let i = 0; i < cells.length; i++) {
if (locals[doc.doctype][doc.name][cells[i].fieldname]) {
if (locals[doc.doctype][doc.name] && locals[doc.doctype][doc.name][cells[i].fieldname]) {
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions frappe/public/js/frappe/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ $.extend(frappe.model, {

get_all_docs: function(doc) {
var all = [doc];
for(var key in doc) {
if($.isArray(doc[key])) {
for (var key in doc) {
if ($.isArray(doc[key]) && !key.startsWith("_")) {
var children = doc[key];
for (var i=0, l=children.length; i < l; i++) {
all.push(children[i]);
Expand Down

0 comments on commit 43b051f

Please sign in to comment.