You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/11/21 01:37:09 UTC

svn commit: r1543994 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java

Author: adrianc
Date: Thu Nov 21 00:37:08 2013
New Revision: 1543994

URL: http://svn.apache.org/r1543994
Log:
Fixed a regression in ModelEntity.java caused by the recent thread-safety refactoring. Patch provided by Leon - https://issues.apache.org/jira/browse/OFBIZ-5399.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=1543994&r1=1543993&r2=1543994&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Thu Nov 21 00:37:08 2013
@@ -337,7 +337,7 @@ public class ModelEntity implements Comp
             ModelField existingField = this.getField(newField.getName());
             if (existingField != null) {
                 // override the existing field's attributes
-                // TODO: only overrides of type, colName and description are currently supported
+                // TODO: only overrides of type, colName, description and enable-audit-log are currently supported
                 String type = existingField.getType();
                 if (!newField.getType().isEmpty()) {
                     type = newField.getType();
@@ -350,9 +350,13 @@ public class ModelEntity implements Comp
                 if (!newField.getDescription().isEmpty()) {
                     description = newField.getDescription();
                 }
+                boolean enableAuditLog = existingField.getEnableAuditLog();
+                if (UtilValidate.isNotEmpty(fieldElement.getAttribute("enable-audit-log"))) {
+                    enableAuditLog = "true".equals(fieldElement.getAttribute("enable-audit-log"));
+                }
                 newField = ModelField.create(this, description, existingField.getName(), type, colName, existingField.getColValue(), existingField.getFieldSet(),
                         existingField.getIsNotNull(), existingField.getIsPk(), existingField.getEncrypt(), existingField.getIsAutoCreatedInternal(),
-                        existingField.getEnableAuditLog(), existingField.getValidators());
+                        enableAuditLog, existingField.getValidators());
             }
             // add to the entity as a new field
             synchronized (fieldsLock) {