diff --git a/migration/iD11/oracle/202409231821_IDEMPIERE-6248_DelSysConfig.sql b/migration/iD11/oracle/202409231821_IDEMPIERE-6248_DelSysConfig.sql new file mode 100644 index 0000000000..df393c1950 --- /dev/null +++ b/migration/iD11/oracle/202409231821_IDEMPIERE-6248_DelSysConfig.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-6248 +SELECT register_migration_script('202409231821_IDEMPIERE-6248_DelSysConfig.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +DELETE FROM AD_SysConfig WHERE AD_SysConfig_ID = 200250 +; diff --git a/migration/iD11/postgresql/202409231821_IDEMPIERE-6248_DelSysConfig.sql b/migration/iD11/postgresql/202409231821_IDEMPIERE-6248_DelSysConfig.sql new file mode 100644 index 0000000000..9146a8de45 --- /dev/null +++ b/migration/iD11/postgresql/202409231821_IDEMPIERE-6248_DelSysConfig.sql @@ -0,0 +1,5 @@ +-- IDEMPIERE-6248 +SELECT register_migration_script('202409231821_IDEMPIERE-6248_DelSysConfig.sql') FROM dual; + +DELETE FROM AD_SysConfig WHERE AD_SysConfig_ID = 200250 +; diff --git a/org.adempiere.base.process/src/org/idempiere/process/MigraID.java b/org.adempiere.base.process/src/org/idempiere/process/MigraID.java index 808a7a4f85..3001953ceb 100644 --- a/org.adempiere.base.process/src/org/idempiere/process/MigraID.java +++ b/org.adempiere.base.process/src/org/idempiere/process/MigraID.java @@ -109,7 +109,7 @@ protected String doIt() throws Exception { .append(" WHERE ").append(uuidCol).append("=?"); int cnt = DB.executeUpdateEx(updUUIDSB.toString(), new Object[] {p_UUID_To, p_UUID_From}, get_TrxName()); if (cnt <= 0) { - msg = "@Error@: UUID " + p_UUID_From + " not found on table " + l_tableName; + msg = "@Error@ UUID " + p_UUID_From + " not found on table " + l_tableName; } else { int id = -1; msg = "UUID changed on table " + l_tableName + " from " + p_UUID_From + " to " + p_UUID_To; @@ -144,7 +144,7 @@ protected String doIt() throws Exception { // convert ID int cnt = updID(l_tableName, idCol, true); if (cnt <= 0) { - msg = "@Error@: ID " + p_ID_From + " not found on table " + l_tableName; + msg = "@Error@ ID " + p_ID_From + " not found on table " + l_tableName; } else { msg = "ID changed on table " + l_tableName + " from " + p_ID_From + " to " + p_ID_To; addBufferLog(0, null, null, msg, p_AD_Table_ID, p_ID_To); diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 13d905f9db..c1a73d81a6 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -120,7 +120,6 @@ public class MSysConfig extends X_AD_SysConfig public static final String FORM_SQL_QUERY_LOG_ISSUE = "FORM_SQL_QUERY_LOG_ISSUE"; public static final String FORM_SQL_QUERY_MAX_RECORDS = "FORM_SQL_QUERY_MAX_RECORDS"; public static final String FORM_SQL_QUERY_TIMEOUT_IN_SECONDS = "FORM_SQL_QUERY_TIMEOUT_IN_SECONDS"; - public static final String FULL_EXCEPTION_TRACE_IN_LOG = "FULL_EXCEPTION_TRACE_IN_LOG"; public static final String GLOBAL_MAX_QUERY_RECORDS = "GLOBAL_MAX_QUERY_RECORDS"; public static final String GLOBAL_MAX_REPORT_RECORDS = "GLOBAL_MAX_REPORT_RECORDS"; public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS"; diff --git a/org.adempiere.base/src/org/compiere/model/SystemProperties.java b/org.adempiere.base/src/org/compiere/model/SystemProperties.java index 611497068c..bd284de353 100644 --- a/org.adempiere.base/src/org/compiere/model/SystemProperties.java +++ b/org.adempiere.base/src/org/compiere/model/SystemProperties.java @@ -49,6 +49,7 @@ public class SystemProperties { private static final String org_idempiere_db_debug_convert = "org.idempiere.db.debug.convert"; private static final String org_idempiere_db_debug_filter = "org.idempiere.db.debug.filter"; private static final String org_idempiere_FileLogPrefix = "org.idempiere.FileLogPrefix"; + private static final String org_idempiere_FullExceptionTraceInLog = "org.idempiere.FullExceptionTraceInLog"; private static final String org_idempiere_postgresql_URLParameters = "org.idempiere.postgresql.URLParameters"; private static final String org_idempiere_po_useOptimisticLocking = "org.idempiere.po.useOptimisticLocking"; private static final String PostgreSQLNative = "PostgreSQLNative"; @@ -277,4 +278,11 @@ public static boolean isTraceNullTrxConnection() { return "true".equals(System.getProperty(TRACE_NULL_TRX_CONNECTION)); } + /** + * org_idempiere_FullExceptionTraceInLog=true to not cut trace log + * @return + */ + public static boolean isFullExceptionTraceInLog() { + return "true".equals(System.getProperty(org_idempiere_FullExceptionTraceInLog)); + } } diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java index 4ee13a218f..d30e631ce4 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java @@ -24,6 +24,7 @@ import java.util.logging.Level; import org.compiere.model.GridField; +import org.compiere.model.I_AD_PrintFormatItem; import org.compiere.model.MRole; import org.compiere.model.X_AD_PrintFormatItem; import org.compiere.util.CCache; @@ -49,9 +50,9 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem implements ImmutableP /** * generated serial id */ - private static final long serialVersionUID = 2950704375830865408L; + private static final long serialVersionUID = -971583490682254014L; - /** + /** * UUID based Constructor * @param ctx Context * @param AD_PrintFormatItem_UU UUID key @@ -179,20 +180,51 @@ public MPrintFormatItem(Properties ctx, MPrintFormatItem copy, String trxName) private static CLogger s_log = CLogger.getCLogger (MPrintFormatItem.class); + public String getPrintName (boolean useNameWhenEmpty) { + String printName = getPrintName(); + if (Util.isEmpty(printName, true) && useNameWhenEmpty) { + return getName(); + } + + return printName; + } /** - * Get print name with language + * Get print name with language
+ * Order of alternative values when encountering empty value
+ * * @param language language - ignored if IsMultiLingualDocument not 'Y' * @return print name */ public String getPrintName (Language language) { if (language == null || Env.isBaseLanguage(language, "AD_PrintFormatItem")) - return getPrintName(); + return getPrintName(true); loadTranslations(); String retValue = (String)m_translationLabel.get(language.getAD_Language()); - if (retValue == null || retValue.length() == 0) - return getPrintName(); - return retValue; + String altValue = retValue; + + // try print name on base language + if (Util.isEmpty(altValue, true)) + altValue = getPrintName(); + + // try translate of name + if (Util.isEmpty(altValue, true)) + altValue = get_Translation(I_AD_PrintFormatItem.COLUMNNAME_Name, language.getAD_Language()); + + // try name on base language + if (Util.isEmpty(altValue, true)) + altValue = getName(); + + // put value to cache + if (Util.isEmpty(retValue, true) && !Util.isEmpty(altValue, true)) + m_translationLabel.put(language.getAD_Language(), altValue); + + return altValue; } // getPrintName /** diff --git a/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java b/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java index 5b35fd8986..e24d47b21d 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java +++ b/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java @@ -1662,7 +1662,7 @@ private PrintElement layoutTable (MPrintFormat format, PrintData printData, } columnHeader[col] = new ValueNamePair(item.getColumnName(), item.getPrintName(format.getLanguage())); - colPositions.put(item.getPrintName(), col); + colPositions.put(item.getPrintName(true), col); columnMaxWidth[col] = item.getMaxWidth(); fixedWidth[col] = (columnMaxWidth[col] != 0 && item.isFixedWidth()); colSuppressRepeats[col] = item.isSuppressRepeats(); diff --git a/org.adempiere.base/src/org/compiere/process/SvrProcess.java b/org.adempiere.base/src/org/compiere/process/SvrProcess.java index 114db9deea..ed3765bf7a 100644 --- a/org.adempiere.base/src/org/compiere/process/SvrProcess.java +++ b/org.adempiere.base/src/org/compiere/process/SvrProcess.java @@ -249,7 +249,7 @@ private boolean process() @SuppressWarnings("unchecked") List errorsBP = (List) eventBP.getProperty(IEventManager.EVENT_ERROR_MESSAGES); if (errorsBP != null && !errorsBP.isEmpty()) { - msg = "@Error@:" + errorsBP.get(0); + msg = "@Error@" + errorsBP.get(0); } else { msg = doIt(); if (msg != null && ! msg.startsWith("@Error@")) { @@ -257,7 +257,7 @@ private boolean process() @SuppressWarnings("unchecked") List errorsAP = (List) eventAP.getProperty(IEventManager.EVENT_ERROR_MESSAGES); if (errorsAP != null && !errorsAP.isEmpty()) { - msg = "@Error@:" + errorsAP.get(0); + msg = "@Error@" + errorsAP.get(0); } } } diff --git a/org.adempiere.base/src/org/compiere/util/CLogFormatter.java b/org.adempiere.base/src/org/compiere/util/CLogFormatter.java index 523712bd88..b8479b75c1 100644 --- a/org.adempiere.base/src/org/compiere/util/CLogFormatter.java +++ b/org.adempiere.base/src/org/compiere/util/CLogFormatter.java @@ -16,8 +16,6 @@ *****************************************************************************/ package org.compiere.util; -import static org.compiere.model.MSysConfig.FULL_EXCEPTION_TRACE_IN_LOG; - import java.awt.Toolkit; import java.rmi.ServerException; import java.sql.SQLException; @@ -27,7 +25,6 @@ import java.util.logging.Level; import java.util.logging.LogRecord; -import org.compiere.model.MSysConfig; import org.compiere.model.SystemProperties; /** @@ -303,7 +300,7 @@ private static void fillExceptionTrace (StringBuffer sb, String hdr, Throwable t if (adempiereTrace) sb.append("\tat ").append(trace[i]).append(NL); } - else if (!MSysConfig.getBooleanValue(FULL_EXCEPTION_TRACE_IN_LOG, false) && (i > 20 || (i > 10 && adempiereTraceNo > 8))) + else if (!SystemProperties.isFullExceptionTraceInLog() && (i > 20 || (i > 10 && adempiereTraceNo > 8))) break; else sb.append("\tat ").append(trace[i]).append(NL); diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java index 5a53a619e5..3e33c20da4 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java @@ -119,7 +119,7 @@ private void installPackages(String folders) { addLog(Level.WARNING, msg); if (getProcessInfo() != null) { getProcessInfo().setError(true); - getProcessInfo().setSummary("@Error@: " + msg); + getProcessInfo().setSummary("@Error@ " + msg); } break; } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/idempiere/ui/zk/report/CSVReportViewerRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/idempiere/ui/zk/report/CSVReportViewerRenderer.java index 2b95c5c5c2..3ec43ea24c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/idempiere/ui/zk/report/CSVReportViewerRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/idempiere/ui/zk/report/CSVReportViewerRenderer.java @@ -25,7 +25,6 @@ import java.util.logging.Level; import org.adempiere.base.Core; -import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.window.ZkReportViewer; import org.compiere.print.ReportEngine; import org.compiere.tools.FileUtil; @@ -91,7 +90,7 @@ public AMedia renderMedia(ZkReportViewer viewer, boolean export) { File file = FileUtil.createTempFile(prefix, "."+getFileExtension(), new File(path)); IReportRenderer renderer = Core.getReportRenderer(getId()); CSVReportRendererConfiguration config = new CSVReportRendererConfiguration() - .setLanguage(AEnv.getLanguage(Env.getCtx())) + .setLanguage(reportEngine.getPrintFormat().getLanguage()) .setOutputFile(file); renderer.renderReport(reportEngine, config); return new AMedia(file.getName(), getFileExtension(), getContentType(), file, false);