Fix to skip, not blow up, on unrecognized field names

This commit is contained in:
2023-05-03 16:47:03 -05:00
parent 4aa1aed632
commit 9c5106d7a8

View File

@ -41,6 +41,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.utils.CollectionUtils; import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
import com.kingsrook.qqq.backend.core.utils.StringUtils; import com.kingsrook.qqq.backend.core.utils.StringUtils;
import com.kingsrook.qqq.backend.core.utils.ValueUtils; import com.kingsrook.qqq.backend.core.utils.ValueUtils;
import static com.kingsrook.qqq.backend.core.logging.LogUtils.logPair;
/******************************************************************************* /*******************************************************************************
@ -303,6 +304,8 @@ public class QValueFormatter
for(String fieldName : record.getValues().keySet()) for(String fieldName : record.getValues().keySet())
{ {
if(!fieldMap.containsKey(fieldName)) if(!fieldMap.containsKey(fieldName))
{
try
{ {
if(fieldName.contains(".")) if(fieldName.contains("."))
{ {
@ -321,6 +324,15 @@ public class QValueFormatter
fieldMap.put(fieldName, table.getField(fieldName)); fieldMap.put(fieldName, table.getField(fieldName));
} }
} }
catch(Exception e)
{
///////////////////////////////////////////////////////////
// put an empty field in - so no formatting will be done //
///////////////////////////////////////////////////////////
LOG.info("Error getting field for setting display value", e, logPair("fieldName", fieldName), logPair("tableName", table.getName()));
fieldMap.put(fieldName, new QFieldMetaData());
}
}
} }
setDisplayValuesInRecord(fieldMap, record); setDisplayValuesInRecord(fieldMap, record);