Skip to content

Commit

Permalink
fix multiedit action 'save article' (#4563)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo authored Jul 9, 2024
1 parent c5738fa commit e3d362b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ export function AuthoringService(
*/
this.save = function saveAuthoring(
origItem: IArticle,
_item: IArticle,
__item: IArticle,
requestEditor3DirectivesToGenerateHtml?: Array<()=> void>,
cloneAfterGeneratingHtml?: boolean,
) {
for (const fn of (requestEditor3DirectivesToGenerateHtml ?? [])) {
fn();
}

const _item = cloneAfterGeneratingHtml === true ? cloneDeep(__item) : __item;

return authoringApiCommon.saveBefore(_item, origItem).then((item: IArticle) => {
angular.extend(_item, item);

Expand Down Expand Up @@ -603,6 +606,7 @@ export function AuthoringService(
const authoringWorkspace: AuthoringWorkspaceService = $injector.get('authoringWorkspace');

authoringWorkspace.update(origItem);

return origItem;
});
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/apps/authoring/multiedit/multiedit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ function MultieditArticleDirective(authoring, content, multiEdit, lock, $timeout
scope.save = function() {
return authoring.save(
scope.origItem,
cloneDeep(scope.item),
scope.item,
scope.requestEditor3DirectivesToGenerateHtml,
true,
).then((res) => {
scope.dirty = false;
InitializeMedia.initMedia(scope);
Expand Down

0 comments on commit e3d362b

Please sign in to comment.