Openbravo Issue Tracking System - Openbravo ERP
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0045775||Openbravo ERP||A. Platform||public||2021-01-21 11:09||2021-01-25 09:33|
|Target Version||PR20Q4.2||Fixed in Version||PR20Q4.2|
|Merge Request Status|
|Review Assigned To|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
|Summary||0045775: 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.|
|2021-01-25 06:56||alostale||Type||defect => backport|
|2021-01-25 06:56||alostale||Target Version||=> PR20Q4.2|
|2021-01-25 09:21||hgbot||Note Added: 0125746|
|2021-01-25 09:33||hgbot||Resolution||open => fixed|
|2021-01-25 09:33||hgbot||Status||scheduled => closed|
|2021-01-25 09:33||hgbot||Note Added: 0125751|
|2021-01-25 09:33||hgbot||Fixed in Version||=> PR20Q4.2|
|2021-01-25 09:33||hgbot||Note Added: 0125752|