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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030571
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2015-08-13 12:532015-09-04 11:16
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision5a32bf149f40
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

0030571: It is not possible to remove a row if it contains a mandatory image

DescriptionIf a suer tries to remove a row from a table that has a mandatory image column, an error message will be shown and the row will not be removed.

The error shown is: "null value in column “imageColumn” violates not-null constraint"
Steps To Reproduce- Execute an update query to assign an image to all products.
- Modify the ad_image_id of the m_product table and make it not null. Update it also in the application dictionary to make it mandatory.
- As F&B Admin, create a new product and assign it a new image. Save the record
- Select the record and try to remove it. An error message will be shown and the record will not be deleted.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0040046 closedcaristu unnecessary objects are created every time any DAL object is created/updated/deleted 

-  Notes
(0079349)
hgbot (developer)
2015-08-13 13:36

Repository: erp/devel/pi
Changeset: e75e4dc96dca2230210983b2cf6a4953901d6f7c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Aug 13 13:31:57 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e75e4dc96dca2230210983b2cf6a4953901d6f7c [^]

Fixes issue 30571: Rows with mandatory image columns can be removed

When a row contains columns that use the ad_image reference, those images are removed when the row is removed in the RemoveImagesEventHandler. This is an event handler that is executed before the row is removed, so removing the image results in a query like this:

update my_table set my_image_field = null

This is a problem is the image column is mandatory.

There were two ways to fix this:
- Give support to event handlers that are executed after the row is removed.
- Set a dummy image to the deleted row, to avoid breaking the not null constraint.

The first option is very complex, so the first one has been chosen.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
---
(0079351)
alostale (manager)
2015-08-14 09:12

Reopening due to some performance issues:

* This new logic should be executed only for mandatory image columns, now it is executed for all
* getDummyImage should be executed only if needed, now it is executed always
* Dummy image should be identified by a special ID rather than by name, ad_image is not indexed by name, looking up dummy image by this column causes a sequential scan which can perform badly with big amount of image records
(0079361)
hgbot (developer)
2015-08-14 13:26

Repository: erp/devel/pi
Changeset: 5a32bf149f40131d3f7bf643b2be3af0979bd3ae
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Aug 14 13:23:23 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5a32bf149f40131d3f7bf643b2be3af0979bd3ae [^]

Fixes issue 30571: Creates a dummy image only when needed, fetches it via its id

The initial fix was suboptimal as the dummy image was queried/created even if its property was not mandatory. Also, the image was initially fetch via its name, which is a non indexes column. Now it is fetched via its id.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
---
(0079550)
hudsonbot (developer)
2015-08-20 23:16

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/8c91718397a5 [^]
Maturity status: Test
(0079553)
hudsonbot (developer)
2015-08-20 23:16

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/8c91718397a5 [^]
Maturity status: Test
(0080037)
dmitry_mezentsev (developer)
2015-09-03 10:48

Not closed for 20 days!!!
(0080088)
alostale (manager)
2015-09-04 11:16

code reviewed + tested

Reported performance problems are now fixed

- Issue History
Date Modified Username Field Change
2015-08-13 12:53 AugustoMauch New Issue
2015-08-13 12:53 AugustoMauch Assigned To => platform
2015-08-13 12:53 AugustoMauch Modules => Core
2015-08-13 12:53 AugustoMauch Triggers an Emergency Pack => No
2015-08-13 13:33 AugustoMauch Issue Monitored: alostale
2015-08-13 13:33 AugustoMauch Review Assigned To => alostale
2015-08-13 13:36 hgbot Checkin
2015-08-13 13:36 hgbot Note Added: 0079349
2015-08-13 13:36 hgbot Status new => resolved
2015-08-13 13:36 hgbot Resolution open => fixed
2015-08-13 13:36 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e75e4dc96dca2230210983b2cf6a4953901d6f7c [^]
2015-08-14 09:09 alostale Assigned To platform => AugustoMauch
2015-08-14 09:12 alostale Note Added: 0079351
2015-08-14 09:12 alostale Status resolved => new
2015-08-14 09:12 alostale Resolution fixed => open
2015-08-14 13:26 hgbot Checkin
2015-08-14 13:26 hgbot Note Added: 0079361
2015-08-14 13:26 hgbot Status new => resolved
2015-08-14 13:26 hgbot Resolution open => fixed
2015-08-14 13:26 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/e75e4dc96dca2230210983b2cf6a4953901d6f7c [^] => http://code.openbravo.com/erp/devel/pi/rev/5a32bf149f40131d3f7bf643b2be3af0979bd3ae [^]
2015-08-20 23:16 hudsonbot Checkin
2015-08-20 23:16 hudsonbot Note Added: 0079550
2015-08-20 23:16 hudsonbot Checkin
2015-08-20 23:16 hudsonbot Note Added: 0079553
2015-09-03 10:48 dmitry_mezentsev Note Added: 0080037
2015-09-04 11:16 alostale Note Added: 0080088
2015-09-04 11:16 alostale Status resolved => closed
2019-01-30 13:22 caristu Relationship added related to 0040046


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker