Bugzilla – Attachment 35181 Details for
Bug 13578
Parameter public is lost on creating a report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13578: Make sure the 'public' parameter is passed to the last step
Bug-13578-Make-sure-the-public-parameter-is-passed.patch (text/plain), 4.60 KB, created by
Jonathan Druart
on 2015-01-14 11:12:14 UTC
(
hide
)
Description:
Bug 13578: Make sure the 'public' parameter is passed to the last step
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-01-14 11:12:14 UTC
Size:
4.60 KB
patch
obsolete
>From a718321122ca8d36a6ef1f9d4a71e4a43bc052c5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 14 Jan 2015 12:03:10 +0100 >Subject: [PATCH] Bug 13578: Make sure the 'public' parameter is passed to the > last step > >If no caching system is up ($usecache == 0), the public parameter is >lost on the step 3. >The hash passed to the template looks like: > 'cache_expiry', 300, > 'cache_expiry_units', > 'public', 1 >So the template receives cache_expiry = 300, cache_expiry_units = >'public' and 1 = undef. > >This patch fixes the problem passing the cache_expiry* parameters only >if the usecache is set. > >Test plan: >0/ Disable any caching system >1/ Create a new public report and go up to the 6th step, save the report >and verify the report is created as public >2/ Enable a caching system >2/ Create a public report with a cache expiry value, save it and verify >the report is created as public and the cache expiry value is correct. >--- > reports/guided_reports.pl | 35 ++++++++++++++++++++++++++--------- > 1 file changed, 26 insertions(+), 9 deletions(-) > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 9b09ac0..a3009b2 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -215,8 +215,6 @@ elsif ( $phase eq 'Update SQL'){ > 'group' => $group, > 'subgroup' => $subgroup, > 'notes' => $notes, >- 'cache_expiry' => $cache_expiry, >- 'cache_expiry_units' => $cache_expiry_units, > 'public' => $public, > 'problematic_authvals' => $problematic_authvals, > 'warn_authval_problem' => 1, >@@ -231,7 +229,6 @@ elsif ( $phase eq 'Update SQL'){ > group => $group, > subgroup => $subgroup, > notes => $notes, >- cache_expiry => $cache_expiry, > public => $public, > } ); > $template->param( >@@ -240,6 +237,12 @@ elsif ( $phase eq 'Update SQL'){ > 'id' => $id, > ); > } >+ if ( $usecache ) { >+ $template->param( >+ cache_expiry => $cache_expiry, >+ cache_expiry_units => $cache_expiry_units, >+ ); >+ } > } > } > >@@ -312,6 +315,7 @@ elsif ( $phase eq 'Choose these columns' ) { > my $type = $input->param('type'); > my @columns = $input->param('columns'); > my $column = join( ',', @columns ); >+ > $template->param( > 'build4' => 1, > 'area' => $area, >@@ -319,10 +323,15 @@ elsif ( $phase eq 'Choose these columns' ) { > 'column' => $column, > definitions => get_from_dictionary($area), > criteria => get_criteria($area,$input), >- 'cache_expiry' => $input->param('cache_expiry'), >- 'cache_expiry_units' => $input->param('cache_expiry_units'), > 'public' => $input->param('public'), > ); >+ if ( $usecache ) { >+ $template->param( >+ cache_expiry => $input->param('cache_expiry'), >+ cache_expiry_units => $input->param('cache_expiry_units'), >+ ); >+ } >+ > } > > elsif ( $phase eq 'Choose these criteria' ) { >@@ -373,10 +382,14 @@ elsif ( $phase eq 'Choose these criteria' ) { > 'column' => $column, > 'definition' => $definition, > 'criteriastring' => $query_criteria, >- 'cache_expiry' => $input->param('cache_expiry'), >- 'cache_expiry_units' => $input->param('cache_expiry_units'), > 'public' => $input->param('public'), > ); >+ if ( $usecache ) { >+ $template->param( >+ cache_expiry => $input->param('cache_expiry'), >+ cache_expiry_units => $input->param('cache_expiry_units'), >+ ); >+ } > > # get columns > my @columns = split( ',', $column ); >@@ -555,13 +568,17 @@ elsif ( $phase eq 'Save Report' ) { > 'reportname' => $name, > 'type' => $type, > 'notes' => $notes, >- 'cache_expiry' => $cache_expiry, >- 'cache_expiry_units' => $cache_expiry_units, > 'public' => $public, > 'problematic_authvals' => $problematic_authvals, > 'warn_authval_problem' => 1, > 'phase_save' => 1 > ); >+ if ( $usecache ) { >+ $template->param( >+ cache_expiry => $cache_expiry, >+ cache_expiry_units => $cache_expiry_units, >+ ); >+ } > } else { > # No params problem found or asked to save anyway > my $id = save_report( { >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13578
:
35181
|
36152
|
36379