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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032375
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorrandom2016-02-29 14:122016-03-17 10:56
ReporterngarciaView Statuspublic 
Assigned Toalostale 
PriorityhighResolutionfixedFixed in Version3.0PR16Q2
StatusclosedFix in branchFixed in SCM revision94f9263bb271
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032375: preferences incorrectly resolve client visibility

DescriptionHaving the same preference with two records defined as:
  1. visible at System client
  2. visible at specific client


Behavior when retrieving the value for this property is undefined:
  1. Sometimes it can correctly return client specific value, which is the expected behavior
  2. Some other times a PropertyConflictException is thrown
Steps To Reproduce1. Go to Preferences window
2. Create a preference with system client visibility
3. Create the same preference with different value and visibility for concrete client
4. Try to retrieve that preference's value for that concrete client:
  -> sometimes PropertyConflictException will be thrown, whereas some others specific client value will be obtained
Proposed Solution1. Make property resolution predictable so, in case of conflict, it always works in the same manner.
2. Implement proper handling of client visibility resolution. Preferences.isHigherPriority method needs to be revisited for client level resolution, this is current code which is incorrect:
    if ((pref2.getVisibleAtClient() == null || pref2.getVisibleAtClient().getId().equals("0"))
        && pref1.getVisibleAtClient() != null && !pref1.getVisibleAtClient().getId().equals("0")) {
      return 1;
    }
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
has duplicate defect 0033156 closedplatform Preferences.getPreferenceValue triggers not needed ad_client (+ probably ad_org loads) 

-  Notes
(0084707)
hgbot (developer)
2016-03-04 09:08

Repository: erp/devel/pi
Changeset: 6a656a96298bee7337800296a14d8c9d869afbdb
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 04 08:45:40 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6a656a96298bee7337800296a14d8c9d869afbdb [^]

related to bug 32375: preferences incorrectly resolve client visibility

  Small code clean up:
    -isHigherPriority renamed to getHighestPriority: by convention is* are boolean
     getters which was not the case of this one
    -removed unneded brackets in condition which didn't help to make the code more
     readable

---
M src/org/openbravo/erpCommon/businessUtility/Preferences.java
---
(0084708)
hgbot (developer)
2016-03-04 09:08

Repository: erp/devel/pi
Changeset: bc3e4c65d7b1bb7a9ecd5185fbf412b5ac6518a6
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 04 08:48:31 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bc3e4c65d7b1bb7a9ecd5185fbf412b5ac6518a6 [^]

related to bug 32375: make preference resolution more consistent

  In case of several preferences defined for a given property/attribute, the
  result of getting value could be undetermistic.

  Solved by sorting by preference's id in these cases.

---
M src/org/openbravo/erpCommon/businessUtility/Preferences.java
---
(0084709)
hgbot (developer)
2016-03-04 09:08

Repository: erp/devel/pi
Changeset: 94f9263bb271e8f1a9ec9959ed26449c1b3dc02b
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 04 08:50:01 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/94f9263bb271e8f1a9ec9959ed26449c1b3dc02b [^]

fixed bug 32375: preferences incorrectly resolve client visibility

  Reimplemented client visibility resolution to correctly handle the case of
  2 preference candidates with different client visibility.

---
M src/org/openbravo/erpCommon/businessUtility/Preferences.java
---
(0084710)
hgbot (developer)
2016-03-04 09:09

Repository: erp/devel/pi
Changeset: d7b14fb65c2b82e5459cbd31363a7b92599d07ff
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 04 08:51:01 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d7b14fb65c2b82e5459cbd31363a7b92599d07ff [^]

related to bug 32375: added test case covering preference's client visibility

---
M src-test/src/org/openbravo/test/preference/PreferenceTest.java
---
(0084754)
caristu (developer)
2016-03-07 09:58
edited on: 2016-03-07 09:59

Code review + tested OK

Tested creating two preferences, both with different value and one with visibility for the system client and the other one for the specific client. Now it is always returned the client specific value, when we are logged in that client.

(0085180)
hudsonbot (developer)
2016-03-17 10:56

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/b22fb0500156 [^]
Maturity status: Test
(0085181)
hudsonbot (developer)
2016-03-17 10:56

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/b22fb0500156 [^]
Maturity status: Test
(0085182)
hudsonbot (developer)
2016-03-17 10:56

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/b22fb0500156 [^]
Maturity status: Test
(0085183)
hudsonbot (developer)
2016-03-17 10:56

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/b22fb0500156 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-02-29 14:12 ngarcia New Issue
2016-02-29 14:12 ngarcia Assigned To => platform
2016-02-29 14:12 ngarcia Modules => Core
2016-02-29 14:12 ngarcia Triggers an Emergency Pack => No
2016-02-29 14:12 ngarcia Issue Monitored: networkb
2016-02-29 14:17 ngarcia Summary isHigerPriority function of Preferences class returns 0 when pref2 is defined as client level and pref1 as system level => isHigherPriority function of Preferences class returns 0 when pref2 is defined as client level and pref1 as system level
2016-02-29 14:17 ngarcia Description Updated View Revisions
2016-03-04 08:32 alostale Reproducibility sometimes => random
2016-03-04 08:32 alostale Summary isHigherPriority function of Preferences class returns 0 when pref2 is defined as client level and pref1 as system level => preferences incorrectly resolve client visibility
2016-03-04 08:32 alostale Description Updated View Revisions
2016-03-04 08:32 alostale Steps to Reproduce Updated View Revisions
2016-03-04 08:32 alostale Proposed Solution updated
2016-03-04 09:06 alostale Assigned To platform => alostale
2016-03-04 09:06 alostale Review Assigned To => caristu
2016-03-04 09:08 hgbot Checkin
2016-03-04 09:08 hgbot Note Added: 0084707
2016-03-04 09:08 hgbot Checkin
2016-03-04 09:08 hgbot Note Added: 0084708
2016-03-04 09:08 hgbot Checkin
2016-03-04 09:08 hgbot Note Added: 0084709
2016-03-04 09:08 hgbot Status new => resolved
2016-03-04 09:08 hgbot Resolution open => fixed
2016-03-04 09:08 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/94f9263bb271e8f1a9ec9959ed26449c1b3dc02b [^]
2016-03-04 09:09 hgbot Checkin
2016-03-04 09:09 hgbot Note Added: 0084710
2016-03-07 09:58 caristu Note Added: 0084754
2016-03-07 09:58 caristu Status resolved => closed
2016-03-07 09:58 caristu Fixed in Version => 3.0PR16Q2
2016-03-07 09:59 caristu Note Edited: 0084754 View Revisions
2016-03-17 10:56 hudsonbot Checkin
2016-03-17 10:56 hudsonbot Note Added: 0085180
2016-03-17 10:56 hudsonbot Checkin
2016-03-17 10:56 hudsonbot Note Added: 0085181
2016-03-17 10:56 hudsonbot Checkin
2016-03-17 10:56 hudsonbot Note Added: 0085182
2016-03-17 10:56 hudsonbot Checkin
2016-03-17 10:56 hudsonbot Note Added: 0085183
2016-06-06 14:17 shuehner Relationship added has duplicate 0033156


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker