Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0045776 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
backport | [Openbravo ERP] A. Platform | trivial | always | 2021-01-21 11:09 | 2021-01-25 09:37 | |||
Reporter | vmromanos | View Status | public | |||||
Assigned To | cberner | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | PR20Q3.4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | PR20Q3.4 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0045776: PrintController.java, increase post() visibility | |||||||
Description | Use case: I want to extend the printing process to: 1) Run some validations before printing a record 2) Run some business logic just after printing a record To achieve that I need to develop a custom class that extends from PrintController and override doPost() to implement my logic and then call the super.doPost(). The problem is that the doPost() runs final VariablesSecureApp vars = new VariablesSecureApp(request); at the beginning of the method, which makes the vars.command to be reset to "DEFAULT". This crashes the "send by email" feature (which expects a vars.command="EMAIL"). To workaround this I could easily override the post() method, which doesn't recalculate the vars variable, and which is called by the doPost(). The problem is that post() has package visibility, so I can't override it outside its package. | |||||||
Steps To Reproduce | Create a class that extends PrintController in an external module. Try to override post(). It's not visible outside the package. | |||||||
Proposed Solution | Change PrintController.post() visibility to public or protected. In the future, we should add some hooks to the printing process to allow easy extensibility. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0125745) hgbot (developer) 2021-01-25 09:19 |
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/270 [^] |
(0125749) hgbot (developer) 2021-01-25 09:32 |
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/270 [^] |
(0125750) hgbot (developer) 2021-01-25 09:32 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/openbravo [^] Changeset: 7f1c5ef96736288e8a042d6cc940172f7b82d97e Author: Cristian Berner <cristian.berner@openbravo.com> Date: 2021-01-25T09:18:48+01:00 URL: https://gitlab.com/openbravo/product/openbravo/-/commit/7f1c5ef96736288e8a042d6cc940172f7b82d97e [^] Fixes ISSUE-45776: Allow extending printing process by increasing post method visibility post method visibility has been set to protected, previously private to allow overriding it by methods that need to. One use-case is to handle vars and modification to vars in this method differently. Those vars are then passed to doPost method. --- M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java --- |
![]() |
|||
Date Modified | Username | Field | Change |
2021-01-25 06:56 | alostale | Type | defect => backport |
2021-01-25 06:56 | alostale | Target Version | => PR20Q3.3 |
2021-01-25 09:19 | hgbot | Note Added: 0125745 | |
2021-01-25 09:32 | hgbot | Merge Request Status | open => approved |
2021-01-25 09:32 | hgbot | Resolution | open => fixed |
2021-01-25 09:32 | hgbot | Status | scheduled => closed |
2021-01-25 09:32 | hgbot | Note Added: 0125749 | |
2021-01-25 09:32 | hgbot | Fixed in Version | => PR20Q3.4 |
2021-01-25 09:32 | hgbot | Note Added: 0125750 | |
2021-01-25 09:37 | alostale | Target Version | PR20Q3.3 => PR20Q3.4 |
Copyright © 2000 - 2009 MantisBT Group |