details:   https://code.openbravo.com/erp/devel/pi/rev/69d55ed0f71c
changeset: 34902:69d55ed0f71c
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Wed Oct 24 17:50:25 2018 +0200
summary:   fixes issue 39531: getModulesOrderedByDependency() result is not 
deterministic

  The JS file containing the static resources is generated by processing them 
in the order defined by the position of their corresponding modules in the list 
returned by the KernelUtils.getModulesOrderedByDependency() method. The module 
sorting is calculated in Java, but it also depends on the order used when 
retrieving the module information from database.

  As there was not a fixed order to retrieve the modules, the result of the 
method was not deterministic, which could lead to generate a different JS file 
with the static resources although they were not being modified.

  To fix the problem we are now retrieving the modules from database with a 
fixed sorting in the getModulesOrderedByDependency() method.

diffstat:

 
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
 |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r f5adc2a709a6 -r 69d55ed0f71c 
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
--- 
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
      Wed Oct 24 10:31:04 2018 +0200
+++ 
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
      Wed Oct 24 17:50:25 2018 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2010-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -243,6 +243,7 @@
       // a module is returned for each module dependency, take care of this in
       // the for-loop below
       final OBCriteria<Module> modules = 
OBDal.getInstance().createCriteria(Module.class);
+      modules.addOrderBy(Module.PROPERTY_ID, true);
       modules.setFetchMode(Module.PROPERTY_MODULEDEPENDENCYLIST, 
FetchMode.JOIN);
       final List<Module> handledModules = new ArrayList<Module>();
       try {


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to