Skip to content

fix: Fix ObjectNotFoundException with saving note metadata when updating draft for existing page and updating draft for new page #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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