Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0041149 | Openbravo ERP | Y. DBSourceManager | public | 2019-06-21 12:03 | 2019-06-26 04:55 |
|
Reporter | javietxe | |
Assigned To | AugustoMauch | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | 3.0PR19Q1.1 | |
Target Version | | Fixed in Version | 3.0PR19Q3 | |
Merge Request Status | |
Review Assigned To | caristu |
OBNetwork customer | Gold |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0041149: It is not possible to delete a module if an alert rule references one of its tabs |
Description | When deleting a module that has a tab referenced by an alert rule, the following error is shown in the console (if the alert rule has produced any alerts)
Example:
[java] 33423 [main] ERROR org.apache.ddlutils.DatabaseOperationException - Error while executing SQL [java] org.postgresql.util.PSQLException: ERROR: update or delete on table "ad_alertrule" violates foreign key constraint "ad_alert_ad_alertrule" on table "ad_alert" [java] Detail: Key (ad_alertrule_id)=(035B3FEA7F244F0E8D85F25CB5FF5C5E) is still referenced from table "ad_alert". |
Steps To Reproduce | - Install the attached module (copy it into modules, run ant ant smartbuild -Dlocal=no). It will include a module with a tab
- Execute the attached sql script. It will insert an alert rule that references the tab of the module, and an alert for the new alert rule.
- Remove the new module from the modules/ folder and compile again. The update.database process will fail because, the alert rule is removed, the alert that references it is not. |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | causes | defect | 0041168 | | closed | AugustoMauch | API Change: on delete cascade added to ad_alert.ad_alertrule_id foreign key |
|
Attached Files | issue41149.rar (4,166) 2019-06-24 17:17 https://issues.openbravo.com/file_download.php?file_id=13050&type=bug
insertAlertRuleAndAlert.sql (517) 2019-06-24 17:29 https://issues.openbravo.com/file_download.php?file_id=13051&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2019-06-21 12:03 | javietxe | New Issue | |
2019-06-21 12:03 | javietxe | Assigned To | => platform |
2019-06-21 12:03 | javietxe | OBNetwork customer | => Gold |
2019-06-21 12:03 | javietxe | Modules | => Core |
2019-06-21 12:03 | javietxe | Triggers an Emergency Pack | => No |
2019-06-24 14:16 | javietxe | Resolution time | => 1562882400 |
2019-06-24 17:17 | AugustoMauch | File Added: issue41149.rar | |
2019-06-24 17:29 | AugustoMauch | Summary | Deleting a module that has referenced data, the update database fails => It is not possible to delete a module if an alert rule references one of its tabs |
2019-06-24 17:29 | AugustoMauch | Description Updated | bug_revision_view_page.php?rev_id=18989#r18989 |
2019-06-24 17:29 | AugustoMauch | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=18991#r18991 |
2019-06-24 17:29 | AugustoMauch | File Added: insertAlertRuleAndAlert.sql | |
2019-06-24 17:33 | hgbot | Checkin | |
2019-06-24 17:33 | hgbot | Note Added: 0112984 | |
2019-06-24 17:33 | hgbot | Status | new => resolved |
2019-06-24 17:33 | hgbot | Resolution | open => fixed |
2019-06-24 17:33 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/f455e5388bd2f2558524d973251e84898dafb7a9 [^] |
2019-06-24 17:55 | shuehner | Assigned To | platform => AugustoMauch |
2019-06-24 17:56 | shuehner | Note Added: 0112987 | |
2019-06-25 09:16 | caristu | Review Assigned To | => caristu |
2019-06-25 10:23 | AugustoMauch | Relationship added | causes 0041168 |
2019-06-25 10:23 | caristu | Note Added: 0112999 | |
2019-06-25 10:23 | caristu | Status | resolved => closed |
2019-06-25 10:23 | caristu | Fixed in Version | => 3.0PR19Q3 |
2019-06-26 04:55 | hudsonbot | Checkin | |
2019-06-26 04:55 | hudsonbot | Note Added: 0113018 | |
Notes |
|
(0112984)
|
hgbot
|
2019-06-24 17:33
|
|
Repository: erp/devel/pi
Changeset: f455e5388bd2f2558524d973251e84898dafb7a9
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Jun 24 17:32:34 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f455e5388bd2f2558524d973251e84898dafb7a9 [^]
Fixes issue 41149: Alerts are deleted on cascade when deleting alert rules
The update.database process was deleting entries from ad_alertrule when a tab referenced by them,
but because if a missing on delete cascade, the entries from ad_alert that referenced them were
not deleted, resulting in a data consistency exception.
---
M src-db/database/model/tables/AD_ALERT.xml
---
|
|
|
|
Possible simpler reproducer: what about just the module shipping an alertrule without the ad_tab connection. Just uninstalling that module owning the rule could maybe run into the same behavior. |
|
|
|
|
|
|
|