Skip to content

Commit

Permalink
fix: Fix ObjectNotFoundException with saving note metadata when updat…
Browse files Browse the repository at this point in the history
…ing draft for existing page and updating draft for new page
  • Loading branch information
azayati committed Oct 15, 2024
1 parent bb12e9a commit 37229c6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ public DraftPage updateDraftForExistPage(DraftPage draftNoteToUpdate,
&& isOriginalFeaturedImage(draftNoteToUpdate, targetPage)) {
featuredImage.setId(0L);
}
properties.setNoteId(Long.parseLong(newDraftPage.getId()));
properties = saveNoteMetadata(properties,
newDraftPage.getLang(),
Long.valueOf(identityManager.getOrCreateUserIdentity(username).getId()));
Expand Down Expand Up @@ -1153,6 +1154,7 @@ public DraftPage updateDraftForNewPage(DraftPage draftNoteToUpdate, long clientT
newDraftPage = dataStorage.updateDraftPageForUser(newDraftPage, Utils.getCurrentUser());
NotePageProperties properties = draftNoteToUpdate.getProperties();
try {
properties.setNoteId(Long.parseLong(newDraftPage.getId()));
properties = saveNoteMetadata(properties, newDraftPage.getLang(), userIdentityId);
} catch (Exception e) {
log.error("Failed to save draft note metadata", e);
Expand Down

0 comments on commit 37229c6

Please sign in to comment.