Bugzilla – Attachment 107573 Details for
Bug 25852
If a layout is edited, the layout type will revert to barcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25852: Improve C4::Creators::Lib reliability under plack
Bug-25852-Improve-C4CreatorsLib-reliability-under-.patch (text/plain), 3.37 KB, created by
ByWater Sandboxes
on 2020-07-30 11:06:40 UTC
(
hide
)
Description:
Bug 25852: Improve C4::Creators::Lib reliability under plack
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-07-30 11:06:40 UTC
Size:
3.37 KB
patch
obsolete
>From db0fd4e9f7b4fb4fa0893db2d0a870d33103bc2a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 30 Jul 2020 12:00:03 +0200 >Subject: [PATCH] Bug 25852: Improve C4::Creators::Lib reliability under plack > >This is certainly a major issue that leads to many side-effects. >Under plack, the structure of the default values are not handled >correctly. >Package variables are used to store stuff like the "layout type". They >are complex structures (arrays of hashes) and returned without being >copied. >When the caller (the controller script) retrieve them then modify the >returned structures, it actually modifies the package's variables. > >One of the issue is: >Create a new layout >The script retrieve a structure with all "selected" flags are set to 0 >It select the first one as default (BAR as selected => 1) >The user creates the new layout and will selected BIBBAR (for instance) >If you then edit this new layout, the script will retrieve the >"label_types" and set "selected" for BIBBAR. However BAR is still >selected! >The UI receives 2 selected and display the first selected one that has >the selected option. > >Test plan: >1. Create a layout type for Barcode/Biblio >2. Choose fields to print and size of font >3. Save >4. Edit existing Layout >=> Withtout this patch "Barcode" is the preselected option >=> With this patch applied, the correct "Barcode/Biblio" option is >selected > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >--- > C4/Creators/Lib.pm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm >index 7d769ea9ac..c26849c898 100644 >--- a/C4/Creators/Lib.pm >+++ b/C4/Creators/Lib.pm >@@ -17,8 +17,8 @@ package C4::Creators::Lib; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; >+use Storable qw(dclone); > > use autouse 'Data::Dumper' => qw(Dumper); > >@@ -405,7 +405,7 @@ This function returns a reference to an array of hashes containing all barcode t > =cut > > sub get_barcode_types { >- return $barcode_types; >+ return dclone $barcode_types; > } > > =head2 C4::Creators::Lib::get_label_types() >@@ -417,7 +417,7 @@ This function returns a reference to an array of hashes containing all label typ > =cut > > sub get_label_types { >- return $label_types; >+ return dclone $label_types; > } > > =head2 C4::Creators::Lib::get_font_types() >@@ -429,7 +429,7 @@ This function returns a reference to an array of hashes containing all font type > =cut > > sub get_font_types { >- return $font_types; >+ return dclone $font_types; > } > > =head2 C4::Creators::Lib::get_text_justification_types() >@@ -441,7 +441,7 @@ This function returns a reference to an array of hashes containing all text just > =cut > > sub get_text_justification_types { >- return $text_justification_types; >+ return dclone $text_justification_types; > } > > =head2 C4::Creators::Lib::get_unit_values() >@@ -455,7 +455,7 @@ There are 72 PS points to the inch. > =cut > > sub get_unit_values { >- return $unit_values; >+ return dclone $unit_values; > } > > =head2 C4::Creators::Lib::get_output_formats() >@@ -467,7 +467,7 @@ This function returns a reference to an array of hashes containing all label out > =cut > > sub get_output_formats { >- return $output_formats; >+ return dclone $output_formats; > } > > >-- >2.11.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 25852
:
107571
|
107572
|
107573
|
107574
|
107607
|
107608
|
107609