Bugzilla – Attachment 126388 Details for
Bug 28445
Use the task queue for the batch delete and update items tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28445: Split and join on ' | ' instead of '|' for repeatable
Bug-28445-Split-and-join-on----instead-of--for-rep.patch (text/plain), 3.00 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-15 18:51:17 UTC
(
hide
)
Description:
Bug 28445: Split and join on ' | ' instead of '|' for repeatable
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-15 18:51:17 UTC
Size:
3.00 KB
patch
obsolete
>From 585660ab5d168ab43efbaa7eaccfd7c1a3d05f0e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 13 Oct 2021 17:51:52 +0200 >Subject: [PATCH] Bug 28445: Split and join on ' | ' instead of '|' for > repeatable > >Is that correct?! > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Item/Attributes.pm | 4 ++-- > t/db_dependent/Koha/Item/Attributes.t | 14 +++++++------- > 2 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/Item/Attributes.pm b/Koha/Item/Attributes.pm >index d75a5c44f6..0c91d3e443 100644 >--- a/Koha/Item/Attributes.pm >+++ b/Koha/Item/Attributes.pm >@@ -60,7 +60,7 @@ sub new_from_marcxml { > my $more_subfields = [ uniq map { $_->[0] } $field->subfields ]; > for my $more_subfield (@$more_subfields) { > my @s = $field->subfield($more_subfield); >- $self->{$more_subfield} = join '|', @s; >+ $self->{$more_subfield} = join ' | ', @s; > } > } > return bless $self, $class; >@@ -113,7 +113,7 @@ sub to_marcxml { > or $self->{$tagsubfield} eq ""; > > if ( $tagslib->{$itemtag}->{$tagsubfield}->{repeatable} ) { >- my @values = split '\|', $self->{$tagsubfield}; >+ my @values = split ' \| ', $self->{$tagsubfield}; > push @subfields, ( $tagsubfield => $_ ) for @values; > } > else { >diff --git a/t/db_dependent/Koha/Item/Attributes.t b/t/db_dependent/Koha/Item/Attributes.t >index c78a397a52..8a46b318fe 100755 >--- a/t/db_dependent/Koha/Item/Attributes.t >+++ b/t/db_dependent/Koha/Item/Attributes.t >@@ -66,7 +66,7 @@ my $some_marc_xml = q{<?xml version="1.0" encoding="UTF-8"?> > <subfield code="y">value for y</subfield> > <subfield code="é">value for é 1</subfield> > <subfield code="é">value for é 2</subfield> >- <subfield code="z">value for z 1|value for z 2</subfield> >+ <subfield code="z">value for z 1 | value for z 2</subfield> > </datafield> > </record> > >@@ -76,19 +76,19 @@ $item->more_subfields_xml($some_marc_xml)->store; > > $attributes = $item->additional_attributes; > is( ref($attributes), 'Koha::Item::Attributes' ); >-is( $attributes->{'x'}, "value for x 1|value for x 2"); >+is( $attributes->{'x'}, "value for x 1 | value for x 2"); > is( $attributes->{'y'}, "value for y"); >-is( $attributes->{'é'}, "value for é 1|value for é 2"); >-is( $attributes->{'z'}, "value for z 1|value for z 2"); >+is( $attributes->{'é'}, "value for é 1 | value for é 2"); >+is( $attributes->{'z'}, "value for z 1 | value for z 2"); > > is( $attributes->to_marcxml, $some_marc_xml ); > is_deeply( > $attributes->to_hashref, > { >- 'x' => "value for x 1|value for x 2", >+ 'x' => "value for x 1 | value for x 2", > 'y' => "value for y", >- 'é' => "value for é 1|value for é 2", >- 'z' => "value for z 1|value for z 2", >+ 'é' => "value for é 1 | value for é 2", >+ 'z' => "value for z 1 | value for z 2", > } > ); > >-- >2.33.1
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 28445
:
121372
|
123221
|
123222
|
123223
|
123224
|
123225
|
123226
|
123227
|
123228
|
123229
|
123239
|
123240
|
125801
|
125802
|
125803
|
125804
|
125805
|
125808
|
125810
|
125811
|
125812
|
125817
|
125865
|
126046
|
126047
|
126136
|
126137
|
126138
|
126139
|
126140
|
126141
|
126142
|
126217
|
126218
|
126219
|
126223
|
126328
|
126329
|
126330
|
126331
|
126332
|
126333
|
126334
|
126335
|
126336
|
126337
|
126338
|
126339
|
126352
|
126353
|
126354
|
126355
|
126356
|
126357
|
126358
|
126359
|
126360
|
126361
|
126362
|
126363
|
126364
|
126365
|
126366
|
126367
|
126374
|
126375
|
126376
|
126377
|
126378
|
126379
|
126380
|
126381
|
126382
|
126383
|
126384
|
126385
|
126386
|
126387
| 126388 |
126389
|
127033
|
127037
|
127038
|
127039
|
128007
|
128008
|
128009