Fixes IDEMPIERE-5684 Bad naming of Automatic 2Packs stop the whole process (#1794)

This commit is contained in:
Carlos Ruiz 2023-04-23 07:19:38 +02:00 committed by GitHub
parent d954b926a2
commit d201650cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -122,6 +122,11 @@ public abstract class AbstractActivator implements BundleActivator, ServiceTrack
int clientId = Env.getAD_Client_ID(Env.getCtx()); int clientId = Env.getAD_Client_ID(Env.getCtx());
if (version == null) { if (version == null) {
String [] parts = fileName.split("_"); String [] parts = fileName.split("_");
if (parts.length < 2) {
logger.warning("Wrong name, ignored " + fileName);
return false;
}
logger.warning(fileName);
String clientValue = parts[1]; String clientValue = parts[1];
clientId = DB.getSQLValueEx(null, "SELECT AD_Client_ID FROM AD_Client WHERE Value=?", clientValue); clientId = DB.getSQLValueEx(null, "SELECT AD_Client_ID FROM AD_Client WHERE Value=?", clientValue);
if (clientId < 0) if (clientId < 0)

View File

@ -150,12 +150,14 @@ public class PackInApplicationActivator extends AbstractActivator{
private boolean packIn(File packinFile) { private boolean packIn(File packinFile) {
if (packinFile != null) { if (packinFile != null) {
String fileName = packinFile.getName(); String fileName = packinFile.getName();
logger.warning("Installing " + fileName + " ...");
// The convention for package names is: yyyymmddHHMM_ClientValue_InformationalDescription.zip // The convention for package names is: yyyymmddHHMM_ClientValue_InformationalDescription.zip
String [] parts = fileName.split("_"); String [] parts = fileName.split("_");
if (parts.length < 2) {
logger.warning("Wrong name, ignored " + fileName);
return false;
}
logger.warning("Installing " + fileName + " ...");
String clientValue = parts[1]; String clientValue = parts[1];
boolean allClients = clientValue.startsWith("ALL-CLIENTS"); boolean allClients = clientValue.startsWith("ALL-CLIENTS");
int[] clientIDs; int[] clientIDs;