adamsaghy commented on code in PR #6116:
URL: https://github.com/apache/fineract/pull/6116#discussion_r3702943686


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientEntityImportHandler.java:
##########
@@ -73,13 +84,32 @@ private List<ClientData> readExcelFile(final Workbook 
workbook, final String loc
         for (int rowIndex = 1; rowIndex <= noOfEntries; rowIndex++) {
             Row row;
             row = clientSheet.getRow(rowIndex);
+            if (row != null) {
+                LOG.info("Processing bulk upload row {} with {} cells", 
row.getRowNum(), row.getLastCellNum());
+            }
             if (ImportHandlerUtils.isNotImported(row, 
ClientEntityConstants.STATUS_COL)) {
                 clients.add(readClient(workbook, row, locale, dateFormat));
             }
         }
         return clients;
     }
 
+    /**
+     * Extracts the code value ID out of a "Name (id)" formatted dropdown 
cell, as written by
+     * {@link 
org.apache.fineract.infrastructure.bulkimport.populator.client.ClientEntityWorkbookPopulator}.
+     */
+    private Long parseIdFromDisplayValue(final String displayValue, final 
String fieldName) {
+        if (displayValue == null) {
+            return null;
+        }
+        String idPart = SearchUtil.extractIdFromDisplayValue(displayValue);
+        if (idPart != null && idPart.matches("\\d+")) {
+            return Long.valueOf(idPart);
+        }
+        LOG.error("Bulk upload error: Could not extract ID from {}. Row data: 
{}", fieldName, displayValue);

Review Comment:
   Is this a real error? I am assuming not necessarily, but logging it as an 
error might misleading no?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to