set cmd and mimetype in returned json data in case of an error when indexing a document/folder

This commit is contained in:
Uwe Steinmann 2022-06-09 12:44:17 +02:00
parent 83fa62a386
commit 12e9a803bc

View File

@ -958,7 +958,7 @@ switch($command) {
$ires = $index->addDocument($idoc);
header('Content-Type: application/json');
if(false === $ires) {
echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$prefix.$object->getID()));
echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$prefix.$object->getID(), 'mimetype'=>$idoc->getMimeType(), 'cmd'=>$idoc->getCmd()));
} else {
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$prefix.$object->getID(), 'cmd'=>$idoc->getCmd()));
}