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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0042871
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2020-01-14 17:192020-01-17 09:48
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR20Q2
StatusclosedFix in branchFixed in SCM revisionda317d971901
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

0042871: missing log for failing DAL property validations

DescriptionWhen DAL fails to validate a property the failing property is logged but not the entity it belongs to.

When the validation that failed is the one checking the size of the value, the complete value is logged, causing a flood in the log.
Steps To Reproduceie. execute the following code:
    Alert a = OBProvider.getInstance().get(Alert.class);
    a.setDescription(org.apache.commons.lang.StringUtils.repeat("-", 2001));

The following error is displayed:
  org.openbravo.base.validation.ValidationException: description: Value (---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------) is too long, it has length 2001, the maximum allowed length is 2000

Proposed SolutionChange the log to:
1. Include entity name
2. First display error info, later context
3. Truncate context if it is too long

In this case the error should be something like

  org.openbravo.base.validation.ValidationException: ADAlert.description is too long, it has length 2001, the maximum allowed length is 2000: Value (------------------------------------------------...)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks design defect 0036162 acknowledgedTriage Platform Base clean up openbravo.log 

-  Notes
(0116887)
alostale (manager)
2020-01-15 10:19

MR: https://gitlab.com/openbravo/product/openbravo/merge_requests/33 [^]
(0116976)
hgbot (developer)
2020-01-17 09:24

Repository: erp/devel/pi
Changeset: da317d9719017833c021481154b4c7fd130adf44
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jan 15 09:14:17 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/da317d9719017833c021481154b4c7fd130adf44 [^]

fixed BUG-42871: missing log for failing DAL property validations

  This fix:
   - Shows in the log the entity name together with the property that
     didn't pass the validation
   - For String too long value validation:
      - It truncates the value shown in log after 100 chars
      - Relevant information (current and max sizes) is displayed before
        the actual value

---
M src/org/openbravo/base/validation/StringPropertyValidator.java
M src/org/openbravo/base/validation/ValidationException.java
---
(0116979)
caristu (developer)
2020-01-17 09:48

Reviewed + tested OK

- Issue History
Date Modified Username Field Change
2020-01-14 17:19 alostale New Issue
2020-01-14 17:19 alostale Assigned To => platform
2020-01-14 17:19 alostale Modules => Core
2020-01-14 17:19 alostale Triggers an Emergency Pack => No
2020-01-14 17:28 alostale Steps to Reproduce Updated View Revisions
2020-01-14 17:28 alostale Proposed Solution updated
2020-01-15 10:19 alostale Note Added: 0116887
2020-01-15 10:20 alostale Relationship added blocks 0036162
2020-01-15 10:20 alostale Assigned To platform => alostale
2020-01-15 10:20 alostale Review Assigned To => caristu
2020-01-17 09:24 hgbot Checkin
2020-01-17 09:24 hgbot Note Added: 0116976
2020-01-17 09:24 hgbot Status new => resolved
2020-01-17 09:24 hgbot Resolution open => fixed
2020-01-17 09:24 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/da317d9719017833c021481154b4c7fd130adf44 [^]
2020-01-17 09:48 caristu Note Added: 0116979
2020-01-17 09:48 caristu Status resolved => closed
2020-01-17 09:48 caristu Fixed in Version => 3.0PR20Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker