Bugzilla – Attachment 112160 Details for
Bug 12446
Enable an adult to have a guarantor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26751: Fix fatal exception if only one repo defined
Bug-26751-Fix-fatal-exception-if-only-one-repo-def.patch (text/plain), 2.24 KB, created by
Kyle M Hall (khall)
on 2020-10-22 10:58:04 UTC
(
hide
)
Description:
Bug 26751: Fix fatal exception if only one repo defined
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-10-22 10:58:04 UTC
Size:
2.24 KB
patch
obsolete
>From 5e5a625ea49d0f693631113db8224b355bb7c367 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 20 Oct 2020 14:40:50 -0300 >Subject: [PATCH] Bug 26751: Fix fatal exception if only one repo defined > >This patch fixes this nasty problem with how XML is parsed: if more than >one entry is found, repo => [] is generated. If only one, repo => {}. > >To test: >1. Have more than one entries in the plugins_repo entry: > ><plugin_repos> > <repo> > <name>ByWater Solutions</name> > <org_name>bywatersolutions</org_name> > <service>github</service> > </repo> > <repo> > <name>Theke Solutions</name> > <org_name>thekesolutions</org_name> > <service>github</service> > </repo> > <repo> > <name>PTFS Europe</name> > <org_name>ptfs-europe</org_name> > <service>github</service> > </repo> > </plugin_repos> > >2. Search for plugins >=> SUCCESS: Searching works! >3. Leave only one entry >4. Restart all to refresh things >5. Try searching for plugins >=> FAIL: Fatal error >6. Apply this patch >7. Repeat 5 >=> SUCCESS: It doesn't explode anymore! >8. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >https://bugs.koha-community.org/show_bug.cgi?id=12446 >--- > plugins/plugins-home.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/plugins/plugins-home.pl b/plugins/plugins-home.pl >index 15c538b553..0ef8f289dc 100755 >--- a/plugins/plugins-home.pl >+++ b/plugins/plugins-home.pl >@@ -66,6 +66,12 @@ if ($plugins_enabled) { > my @results; > if ($plugin_search) { > my $repos = C4::Context->config('plugin_repos'); >+ >+ # Fix data structure if only one repo defined >+ if ( ref($repos->{repo}) eq 'HASH' ) { >+ $repos = { repo => [ $repos->{repo} ] }; >+ } >+ > foreach my $r ( @{ $repos->{repo} } ) { > if ( $r->{service} eq 'github' ) { > my $url = "https://api.github.com/search/repositories?q=$plugin_search+user:$r->{org_name}+in:name,description"; >-- >2.24.1 (Apple Git-126)
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 12446
:
29278
|
36176
|
39744
|
42469
|
42470
|
42535
|
46277
|
46278
|
46327
|
46328
|
46345
|
46486
|
49793
|
50953
|
53534
|
53535
|
53536
|
53913
|
60929
|
60930
|
60934
|
63148
|
63149
|
63214
|
64793
|
64794
|
64828
|
72295
|
72883
|
77766
|
77767
|
77768
|
79343
|
79344
|
79345
|
79347
|
79348
|
85069
|
88364
|
88365
|
88366
|
88367
|
90389
|
90390
|
90391
|
90392
|
90470
|
90471
|
90472
|
90473
|
93388
|
93389
|
93390
|
93391
|
93392
|
93393
|
93394
|
95411
|
95853
|
95854
|
95855
|
95856
|
95857
|
95858
|
95859
|
95860
|
106753
|
106754
|
106755
|
106756
|
106757
|
107611
|
111052
|
111053
|
111317
|
111318
|
112102
|
112160
|
112161
|
112162
|
112163
|
113583
|
121925
|
121926
|
121927
|
121928
|
121929
|
122084
|
122085
|
122086
|
122087
|
122088
|
122089
|
122090
|
122091
|
122184
|
122185
|
122186
|
122187
|
130398
|
130399
|
130400
|
130401
|
130402
|
131965
|
131966
|
131967
|
131968
|
131969
|
133691
|
133952
|
133953
|
133954
|
133955
|
133956
|
133957
|
134930
|
134931
|
134932
|
134933
|
134934
|
134935
|
134936
|
135506
|
135507
|
135508
|
135509
|
135510
|
135511
|
135512
|
135519
|
135520
|
135521
|
135522
|
135523
|
135544
|
135545
|
142401
|
142408
|
142431
|
142432
|
142433
|
142434
|
142435
|
142436
|
142437
|
142438
|
142439