Bugzilla – Attachment 127060 Details for
Bug 28959
virtualshelves.category is really a boolean
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28959: Fix other cases
Bug-28959-Fix-other-cases.patch (text/plain), 6.83 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-28 14:59:28 UTC
(
hide
)
Description:
Bug 28959: Fix other cases
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-28 14:59:28 UTC
Size:
6.83 KB
patch
obsolete
>From d27f88a69b244e8d543f33afb035e56f23fbe180 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 28 Oct 2021 11:58:36 -0300 >Subject: [PATCH] Bug 28959: Fix other cases > >--- > .../bootstrap/en/modules/opac-downloadshelf.tt | 6 +++--- > opac/opac-shareshelf.pl | 6 +++--- > t/db_dependent/selenium/regressions.t | 6 +++--- > virtualshelves/addbybiblionumber.pl | 16 ++++++++-------- > 4 files changed, 17 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt >index b9f5e5e288..92b4f52506 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt >@@ -16,10 +16,10 @@ > <li class="breadcrumb-item"><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a></li> > [% END %] > <li class="breadcrumb-item"> >- [% IF shelf.category == 1 %] >- <a href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a> >- [% ELSE %] >+ [% IF shelf.public %] > <a href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a> > [% END %] > </li> > <li class="breadcrumb-item active"> >diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl >index 57d3538788..29edd82293 100755 >--- a/opac/opac-shareshelf.pl >+++ b/opac/opac-shareshelf.pl >@@ -81,7 +81,7 @@ sub _init { > $shelf = Koha::Virtualshelves->find( $shelfnumber ) unless $param->{errcode}; > $param->{shelfname} = $shelf ? $shelf->shelfname : q||; > $param->{owner} = $shelf ? $shelf->owner : -1; >- $param->{category} = $shelf ? $shelf->category : -1; >+ $param->{public} = $shelf ? $shelf->public : 0; > > load_template($param); > return $param; >@@ -128,7 +128,7 @@ sub show_accept { > # You must not be the owner and the list must be private > if( !$shelf ) { > $param->{errcode} = 2; >- } elsif( $shelf->category == 2 ) { >+ } elsif( $shelf->public ) { > $param->{errcode} = 5; > } elsif( $shelf->owner == $param->{loggedinuser} ) { > $param->{errcode} = 8; >@@ -264,7 +264,7 @@ sub check_owner_category { > #sharing user should be the owner > #list should be private > $param->{errcode} = 4 if $param->{owner} != $param->{loggedinuser}; >- $param->{errcode} = 5 if !$param->{errcode} && $param->{category} != 1; >+ $param->{errcode} = 5 if !$param->{errcode} && $param->{public}; > return !defined $param->{errcode}; > } > >diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t >index 871af73e2e..45ab7b7a5d 100755 >--- a/t/db_dependent/selenium/regressions.t >+++ b/t/db_dependent/selenium/regressions.t >@@ -193,7 +193,7 @@ subtest 'XSS vulnerabilities in pagination' => sub { > $patron->set_password({ password => $password }); > $s->opac_auth( $patron->userid, $password ); > >- my $public_lists = $s->opac_base_url . q|opac-shelves.pl?op=list&category=2|; >+ my $public_lists = $s->opac_base_url . q|opac-shelves.pl?op=list&public=1|; > $driver->get($public_lists); > > $s->remove_error_handler; >@@ -202,7 +202,7 @@ subtest 'XSS vulnerabilities in pagination' => sub { > is( $alert_text, undef, 'No alert box displayed' ); > > my $booh_alert = 'booh!'; >- $public_lists = $s->opac_base_url . qq|opac-shelves.pl?op=list&category=2"><script>alert('$booh_alert')</script>|; >+ $public_lists = $s->opac_base_url . qq|opac-shelves.pl?op=list&public=1"><script>alert('$booh_alert')</script>|; > $driver->get($public_lists); > > $s->remove_error_handler; >@@ -211,7 +211,7 @@ subtest 'XSS vulnerabilities in pagination' => sub { > is( $alert_text, undef, 'No alert box displayed, even if evil intent' ); > > my $second_page = $driver->find_element('//div[@class="pages"]/span[@class="currentPage"]/following-sibling::a'); >- like( $second_page->get_attribute('href'), qr{(?|&)category=2(&|$)}, 'The second page should display category without the invalid value' ); >+ like( $second_page->get_attribute('href'), qr{(?|&)public=1(&|$)}, 'The second page should display category without the invalid value' ); > > push @cleanup, $patron, $patron->category, $patron->library; > >diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl >index 5c2b262a18..ff0ef5045b 100755 >--- a/virtualshelves/addbybiblionumber.pl >+++ b/virtualshelves/addbybiblionumber.pl >@@ -44,9 +44,9 @@ addbybiblionumber.pl > if this parameter exists, then it must be equals to the name of the shelf > to add. > >-=item category >+=item public > >- if this script has to add a shelf, it add one with this category. >+ if this script has to add a shelf, it adds one with this 'public' setting. > > =item newshelf > >@@ -69,7 +69,7 @@ my $query = CGI->new; > my $shelfnumber = $query->param('shelfnumber'); > my $newvirtualshelf = $query->param('newvirtualshelf'); > my $newshelf = $query->param('newshelf'); >-my $category = $query->param('category'); >+my $public = $query->param('public'); > my $sortfield = $query->param('sortfield'); > my $confirmed = $query->param('confirmed') || 0; > my ( $errcode, $authorized ) = ( 0, 1 ); >@@ -95,7 +95,7 @@ if ($newvirtualshelf) { > Koha::Virtualshelf->new( > { > shelfname => $newvirtualshelf, >- category => $category, >+ public => $public, > sortfield => $sortfield, > owner => $loggedinuser, > } >@@ -149,21 +149,21 @@ if ($newvirtualshelf) { > > } else { > my $private_shelves = Koha::Virtualshelves->search( >- { category => 1, >- owner => $loggedinuser, >+ { public => 0, >+ owner => $loggedinuser, > allow_change_from_owner => 1, > }, > { order_by => 'shelfname' } > ); > my $shelves_shared_with_me = Koha::Virtualshelves->search( >- { category => 1, >+ { public => 0, > 'virtualshelfshares.borrowernumber' => $loggedinuser, > allow_change_from_others => 1, > }, > { join => 'virtualshelfshares', } > ); > my $public_shelves = Koha::Virtualshelves->search( >- { category => 2, >+ { public => 1, > -or => [ > -and => { > allow_change_from_owner => 1, >-- >2.32.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 28959
:
124619
|
124620
|
124621
|
124622
|
124623
|
124624
|
124625
|
124663
|
124788
|
124799
|
124800
|
124801
|
124802
|
124803
|
124807
|
124808
|
124809
|
124810
|
124811
|
127046
|
127047
|
127048
|
127049
|
127050
|
127059
|
127060
|
127062
|
127142
|
127206
|
128036