details:   https://code.openbravo.com/erp/devel/pi/rev/de359036d46b
changeset: 22906:de359036d46b
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Thu Apr 24 11:33:41 2014 +0200
summary:   Fixes issue 26286: Wrong behaviour if same column name exists in tab 
and subtab

This problem was reproducible if:
- There is a column in a subtab with the same column name as another column in 
its parent tab
- The column of the parent tab is flagged as stored in session
- The column of the subtab is not shown in the grid
- The value of the record in the subtab has a null value in that column

If all these conditions are met, then when the record in the subtab is opened 
in the form view, its null value will be replaced with the value of the column 
of its parent tab.

This bug happens because the FIC does the following:
- It invokes setSessionVariablesInParent. This method stores in the 
RequestContext the session variables of the parent tab, among others. At this 
point the stored in session column of the parent tab is stored in the 
RequestContext
- It invokes setValuesInRequest. This method stores in the RequestContext the 
values of the row being opened in the form, but only if does it for the values 
that are not null. In this case, the value is null so it is not stored in the 
RequestContext, so then when the RequestContext is accessed to fetch the column 
values, the value stored in the setSessionVariablesInParent method will be 
returned.

The fix only affects to the FIC calls in EDIT mode. In these calls the actual 
value of the record should take precedence over the values stored in session.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
 |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r ebeddf8b3031 -r de359036d46b 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Thu Apr 24 10:06:42 2014 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Thu Apr 24 11:33:41 2014 +0200
@@ -1249,6 +1249,9 @@
           RequestContext.get().setRequestParameter(
               "inp" + Sqlc.TransformaNombreColumna(columnName), 
currentValue.toString());
         }
+      } else {
+         RequestContext.get().setRequestParameter(
+                  "inp" + Sqlc.TransformaNombreColumna(columnName), null);
       }
     } catch (Exception e) {
       log.error("Couldn't get the value for column " + columnName, e);

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to