IDEMPIERE-1119 Improve error message when Model Validator is not found
This commit is contained in:
parent
b36ffd6fd6
commit
799788d366
|
@ -41,6 +41,7 @@ import org.compiere.acct.Fact;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.KeyNamePair;
|
import org.compiere.util.KeyNamePair;
|
||||||
|
import org.compiere.util.Util;
|
||||||
import org.osgi.service.event.Event;
|
import org.osgi.service.event.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,7 +80,7 @@ public class ModelValidationEngine
|
||||||
/** Engine Singleton */
|
/** Engine Singleton */
|
||||||
private static ModelValidationEngine s_engine = null;
|
private static ModelValidationEngine s_engine = null;
|
||||||
/* flag to indicate a missing model validation class */
|
/* flag to indicate a missing model validation class */
|
||||||
private static String missingModelValidationMessage = null;
|
private static String missingModelValidationMessage = "";
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -159,7 +160,7 @@ public class ModelValidationEngine
|
||||||
|
|
||||||
if (validator == null)
|
if (validator == null)
|
||||||
{
|
{
|
||||||
missingModelValidationMessage = missingModelValidationMessage +
|
missingModelValidationMessage = missingModelValidationMessage + " Missing class " + className +
|
||||||
(client != null ? (" on client " + client.getName()) : " global") + '\n';
|
(client != null ? (" on client " + client.getName()) : " global") + '\n';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -273,7 +274,7 @@ public class ModelValidationEngine
|
||||||
if (AD_User_ID == 0 && AD_Role_ID == 0)
|
if (AD_User_ID == 0 && AD_Role_ID == 0)
|
||||||
; // don't validate for user system on role system
|
; // don't validate for user system on role system
|
||||||
else
|
else
|
||||||
if (missingModelValidationMessage != null) {
|
if (! Util.isEmpty(missingModelValidationMessage)) {
|
||||||
MSystem system = MSystem.get(Env.getCtx());
|
MSystem system = MSystem.get(Env.getCtx());
|
||||||
if (system.isFailOnMissingModelValidator())
|
if (system.isFailOnMissingModelValidator())
|
||||||
return missingModelValidationMessage;
|
return missingModelValidationMessage;
|
||||||
|
|
Loading…
Reference in New Issue