From b519674128862dcfdff515aec967b0ec534cf8f2 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Sun, 12 Dec 2021 14:59:57 -0500 Subject: [PATCH] 2021-12-12 Fred Gleason * Fixed a bug in rdxport(8) that caused the 'SaveLog' WebAPI call to fail if the target log didn't exist. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ web/rdxport/logs.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 29c9e451..718e758e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22756,3 +22756,6 @@ 2021-12-12 Fred Gleason * Added a 'linkLength' field to the return XML for the 'ListLog' WebAPI call. +2021-12-12 Fred Gleason + * Fixed a bug in rdxport(8) that caused the 'SaveLog' WebAPI call + to fail if the target log didn't exist. diff --git a/web/rdxport/logs.cpp b/web/rdxport/logs.cpp index 1bb25507..f0cb886c 100644 --- a/web/rdxport/logs.cpp +++ b/web/rdxport/logs.cpp @@ -257,6 +257,7 @@ void Xport::SaveLog() QDate start_date; QDate end_date; int line_quantity; + QString err_msg; // // Header Data @@ -499,7 +500,12 @@ void Xport::SaveLog() RDLog *log=new RDLog(log_name); if(!log->exists()) { - XmlExit("No such log",404,"logs.cpp",LINE_NUMBER); + if(!RDLog::create(log_name,service_name,QDate(),rda->user()->name(), + &err_msg,rda->config())) { + XmlExit("No such log ["+err_msg+"]",400,"logs.cpp",LINE_NUMBER); + } + SendNotification(RDNotification::LogType,RDNotification::AddAction, + QVariant(log->name())); } if(lock_guid.isEmpty()) { QString username=rda->user()->name();