diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 9bbfc5fbc..4d39937c0 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,7 @@ - fixed: Alias field in user profiling - fixed: Email Receipt after Successful Checkout - fixed: DataForm captcha doesn't show up + - fixed: edit branch only changes meta data fields if another value is changed 7.5.16 - Created a migration from 7.4.40 directly to 7.5.16. diff --git a/lib/WebGUI/AssetBranch.pm b/lib/WebGUI/AssetBranch.pm index a7d26197a..891570945 100644 --- a/lib/WebGUI/AssetBranch.pm +++ b/lib/WebGUI/AssetBranch.pm @@ -285,21 +285,25 @@ sub www_editBranchSave { $wobjectData{url} = $data{url}; } my $newData = $descendant->isa('WebGUI::Asset::Wobject') ? \%wobjectData : \%data; - next - if (scalar %$newData == 0); - my $newRevision = $descendant->addRevision( - $newData, - undef, - {skipAutoCommitWorkflows => 1, skipNotification => 1}, - ); - foreach my $form ($self->session->form->param) { - if ($form =~ /^metadata_(.*)$/) { - my $fieldName = $1; - if ($self->session->form->yesNo("change_metadata_".$fieldName)) { - $newRevision->updateMetaData($fieldName,$self->session->form->process($form)); - } - } - } + my $revision; + if (scalar %$newData > 0) { + $revision = $descendant->addRevision( + $newData, + undef, + {skipAutoCommitWorkflows => 1, skipNotification => 1}, + ); + } + else { + $revision = $descendant; + } + foreach my $form ($self->session->form->param) { + if ($form =~ /^metadata_(.*)$/) { + my $fieldName = $1; + if ($self->session->form->yesNo("change_metadata_".$fieldName)) { + $revision->updateMetaData($fieldName,$self->session->form->process($form)); + } + } + } } if ($self->session->setting->get("autoRequestCommit")) { if ($self->session->setting->get("skipCommitComments")) {