Bugzilla – Attachment 150527 Details for
Bug 30367
Plugins: Search explodes in error when searching for specific keywords
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30367: Skip processing if we don't get releases
Bug-30367-Skip-processing-if-we-dont-get-releases.patch (text/plain), 2.31 KB, created by
David Nind
on 2023-05-02 17:25:34 UTC
(
hide
)
Description:
Bug 30367: Skip processing if we don't get releases
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-05-02 17:25:34 UTC
Size:
2.31 KB
patch
obsolete
>From 6af2a1a7ba205a0fbcf05d1de977d19193c70e81 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 2 May 2023 16:27:15 +0000 >Subject: [PATCH] Bug 30367: Skip processing if we don't get releases > >Some repos don't have releases, and this seems to break things as get returns an empty >response. Calling from_json on this is the error > >This simply skips the bad responses to avoid the error: > >To test: >1. Have this on your koha-conf.xml file: > > <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>gitlab</service> > </repo> > <repo> > <name>PTFS Europe</name> > <org_name>ptfs-europe</org_name> > <service>github</service> > </repo> > </plugin_repos> > >2. Restart all services: > $ restart_all >3. Search for the term 'barclaycard' > >The search will give an error: > >malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190 >4. Apply patch >5. Repeat >6. No error > >Note: The barclaycard plugin won't install even though it is returned as of this note - the plugin needs an update I believe, I don't think it's a Koha issue >Signed-off-by: David Nind <david@davidnind.com> >--- > plugins/plugins-home.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/plugins/plugins-home.pl b/plugins/plugins-home.pl >index c67156222d..133358aecf 100755 >--- a/plugins/plugins-home.pl >+++ b/plugins/plugins-home.pl >@@ -77,7 +77,9 @@ if ($plugins_enabled) { > foreach my $result ( @{ $response->{items} } ) { > next unless $result->{name} =~ /^koha-plugin-/; > my $releases = $result->{url} . "/releases/latest"; >- my $release = from_json( get($releases) ); >+ my $release_info = get($releases); >+ next unless $release_info; >+ my $release = from_json( $release_info ); > my $tag_name = $release->{tag_name}; > for my $asset ( @{$release->{assets}} ) { > if ($asset->{browser_download_url} =~ m/\.kpz$/) { >-- >2.30.2
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 30367
:
150523
|
150527
|
150572
|
150575
|
150576