Bug 19223: Add methods to correctly handle plugin-generated output
commit0ab51a509a2a9d0ced3b2ccd9ff154f670f27560
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 27 Mar 2018 18:56:57 +0000 (27 15:56 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Apr 2018 18:40:07 +0000 (4 15:40 -0300)
tree7bd3eae8af3160d6108fe0ddf20dec425d304ce8
parent1c4ac7dac8b8dece9afd2330077aeda82dddc1c1
Bug 19223: Add methods to correctly handle plugin-generated output

This patch introduces two methods to be used by plugin authors:

->output
->output_html

They are basically wrappers for the helper methods from C4::Output
(output_html_with_http_headers and output_with_http_headers).

Plugin authors can use them, or keep the current flexibility of handling
the headers themselves in their code.

The KitchenSink plugin should be updated to highlight this.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Plugins.t
=> FAIL: The methods are not implemented
- Apply this patch
- Run:
 k$ prove t/db_dependent/Plugins.t
=> SUCCESS: Tests pass, and they are meaningful
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Plugins/Base.pm