Skip to content

Commit cd82745

Browse files
authored
Merge pull request #3205 from ControlSystemStudio/fix_olog_update
Edit olog entry called wrong endpoint
2 parents 1409ed5 + 18856f4 commit cd82745

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/write/LogEntryEditorController.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,25 @@ public void submit() {
599599
if (editMode.equals(EditMode.NEW_LOG_ENTRY)) {
600600
ologLog.setAttachments(attachmentsEditorController.getAttachments());
601601
}
602+
else{
603+
ologLog.setId(logEntry.getId());
604+
}
602605
ologLog.setProperties(logPropertiesEditorController.getProperties());
603606

604607
LogClient logClient =
605608
logFactory.getLogClient(new SimpleAuthenticationToken(usernameProperty.get(), passwordProperty.get()));
606609
try {
607-
if (replyTo == null) {
608-
logEntryResult = Optional.of(logClient.set(ologLog));
609-
} else {
610-
logEntryResult = Optional.of(logClient.reply(ologLog, replyTo));
610+
if(editMode.equals(EditMode.NEW_LOG_ENTRY)){
611+
if (replyTo == null) {
612+
logEntryResult = Optional.of(logClient.set(ologLog));
613+
} else {
614+
logEntryResult = Optional.of(logClient.reply(ologLog, replyTo));
615+
}
616+
}
617+
else{
618+
logEntryResult = Optional.of(logClient.update(ologLog));
611619
}
620+
612621
// Not dirty anymore...
613622
isDirty = false;
614623

0 commit comments

Comments
 (0)