Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028977
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2015-02-18 10:432015-11-23 21:17
ReporteralostaleView Statuspublic 
Assigned Tocaristu 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q1
StatusclosedFix in branchFixed in SCM revision3fd452d82f35
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0028977: NPE if property field can not reach the complete path

DescriptionWhen there is a property field which path can not be completed because there is a null object within it, a NPE is thrown when the tab containing it is opened.
Steps To ReproduceAs system admin role:
 * Create a new field in the Sales Invoice - Header tab
 * Add the following value in the Property field:
     businessPartner.priceList.name

As group admin role:
 * Create a new record in the Sales Invoice window
 * Check the following error message is shown in the log
     1f923ef8 357624 [http-8080-7] ERROR org.openbravo.client.application.window.FormInitializationComponent - Couldn't get data for column Name
java.lang.NullPointerException
    at org.openbravo.dal.core.DalUtil.getValueFromPath(DalUtil.java:174)
    at org.openbravo.client.application.window.FormInitializationComponent.computeColumnValues(FormInitializationComponent.java:625)
    at org.openbravo.client.application.window.FormInitializationComponent.execute(FormInitializationComponent.java:258)

The problem is businessPartner is null, so it is trying to get priceList from a null object resulting in a NPE.
Proposed Solutionin this case the field property value should be null, without NPE in the logs
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00284383.0PR15Q2 closedalostale Property fields cannot be included in validations 
related to defect 00257543.0PR14Q2 closedshankarb Wrong behavior when calculating the value of a property field for a new record (FIC) 
has duplicate defect 0031305 closedplatform NullPointerException when creating a new record on the header having a property field 

-  Notes
(0081800)
hgbot (developer)
2015-11-13 08:44

Repository: erp/devel/pi
Changeset: 3fd452d82f3582f226bc4c9c2d289c518a47ec68
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Nov 13 08:43:20 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3fd452d82f3582f226bc4c9c2d289c518a47ec68 [^]

fixes issue 28977: NPE if property field can not reach the complete path

The NPE was thrown when defining a property field in the header tab. The FIC is using the getValueFromPath() method to calculate the value of the property field on NEW mode. It is sending as parameter the reference to the parent record for the cases where the value of the property field can be retrieved using the parent information. As in the header tabs we do not have a reference to a parent record, the parameter is null in these cases.

To solve the problem now we first check in getValueFromPath() method if the bob passed as parameter is null. In that case we return null in order to avoid the NPE.

---
M src/org/openbravo/dal/core/DalUtil.java
---
(0081825)
alostale (manager)
2015-11-13 14:19

code reviewed

tested:
* Following steps to reproduce: new record
* With same property path, removing price list for a BP that is used in invoice, show a record in Sales Invoice for that BP.

2nd case is not covered by current fix but by existent code:

      if (value instanceof BaseOBObject) {
        currentBob = (BaseOBObject) value;
      } else {
        return value;
      }

when null 1st if is false
(0082222)
hudsonbot (developer)
2015-11-23 21:17

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7b56bebaaa88 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-02-18 10:43 alostale New Issue
2015-02-18 10:43 alostale Assigned To => AugustoMauch
2015-02-18 10:43 alostale Modules => Core
2015-02-18 10:43 alostale Triggers an Emergency Pack => No
2015-02-18 10:43 alostale Relationship added related to 0028438
2015-03-11 09:49 alostale Priority normal => high
2015-03-11 09:49 alostale Status new => acknowledged
2015-03-17 14:37 alostale Assigned To AugustoMauch => platform
2015-11-11 11:37 alostale Priority high => normal
2015-11-12 19:41 caristu Assigned To platform => caristu
2015-11-12 19:41 caristu Status acknowledged => scheduled
2015-11-13 08:44 hgbot Checkin
2015-11-13 08:44 hgbot Note Added: 0081800
2015-11-13 08:44 hgbot Status scheduled => resolved
2015-11-13 08:44 hgbot Resolution open => fixed
2015-11-13 08:44 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3fd452d82f3582f226bc4c9c2d289c518a47ec68 [^]
2015-11-13 08:46 caristu Relationship added has duplicate 0031305
2015-11-13 08:48 caristu Relationship added related to 0025754
2015-11-13 14:19 alostale Review Assigned To => alostale
2015-11-13 14:19 alostale Note Added: 0081825
2015-11-13 14:19 alostale Status resolved => closed
2015-11-13 14:19 alostale Fixed in Version => 3.0PR16Q1
2015-11-23 21:17 hudsonbot Checkin
2015-11-23 21:17 hudsonbot Note Added: 0082222


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker