From 988199824b3cf19b2c5f589ca79bedaf5ff6f937 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 1 Aug 2017 14:36:04 +0200 Subject: [PATCH] S:C:H:ReportGenerator: Ergebnis von layout->get als Liste verwenden Sonst ist der Export (PDF/CSV) von Controllern, die diesen Helper verwenden, kaputt. Fehlermeldung war: Can't locate object method "add" via package "1" (perhaps you forgot to load "1"?) at SL/Controller/Helper/ReportGenerator.pm line 25. --- SL/Controller/Helper/ReportGenerator.pm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/SL/Controller/Helper/ReportGenerator.pm b/SL/Controller/Helper/ReportGenerator.pm index 5a83be4b0..41f0c6c36 100644 --- a/SL/Controller/Helper/ReportGenerator.pm +++ b/SL/Controller/Helper/ReportGenerator.pm @@ -22,16 +22,18 @@ sub _setup_action_bar { my $key = $::form->{CONTROLLER_DISPATCH} ? 'action' : 'report_generator_form.report_generator_dispatch_to'; my $value = $::form->{CONTROLLER_DISPATCH} ? $::form->{CONTROLLER_DISPATCH} . "/" : ''; - $::request->layout->get('actionbar')->add( - action => [ - $type eq 'pdf' ? $::locale->text('PDF export') : $::locale->text('CSV export'), - submit => [ '#report_generator_form', { $key => "${value}report_generator_export_as_${type}" } ], - ], - action => [ - $::locale->text('Back'), - submit => [ '#report_generator_form', { $key => "${value}report_generator_back" } ], - ], - ); + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + $type eq 'pdf' ? $::locale->text('PDF export') : $::locale->text('CSV export'), + submit => [ '#report_generator_form', { $key => "${value}report_generator_export_as_${type}" } ], + ], + action => [ + $::locale->text('Back'), + submit => [ '#report_generator_form', { $key => "${value}report_generator_back" } ], + ], + ); + } } sub action_report_generator_export_as_pdf { -- 2.20.1