Bugzilla – Attachment 190616 Details for
Bug 41476
Plugins table explode if one of the plugin is in error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41476: Fix plugins table when one of the plugin has errors
2ec5250.patch (text/plain), 17.56 KB, created by
Jonathan Druart
on 2025-12-18 12:39:56 UTC
(
hide
)
Description:
Bug 41476: Fix plugins table when one of the plugin has errors
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-12-18 12:39:56 UTC
Size:
17.56 KB
patch
obsolete
>From 2ec52503c1ebb39462cfcda43f7589b3fa498dac Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 18 Dec 2025 13:37:20 +0100 >Subject: [PATCH] Bug 41476: Fix plugins table when one of the plugin has > errors > >I've tried to install one of my old plugin and it exploded. > >https://gitlab.com/joubu/koha-plugin-jump > >Test plan: >Install a broken plugin and notice the Datatable error on the plugins >list >With this patch applied the error is gone >--- > .../prog/en/modules/plugins/plugins-home.tt | 161 +++++++++--------- > 1 file changed, 79 insertions(+), 82 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >index 90ea09d696f..de3603fe0c5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >@@ -171,23 +171,16 @@ > </thead> > > [% FOREACH plugin IN plugins %] >- [% IF plugin.error %] >- <tr class="warn"> >- <td> >+ <tr> >+ <td> >+ [% UNLESS plugin.error %] >+ <strong>[% plugin.metadata.name | html %]</strong> >+ [% ELSE %] > <strong>[% plugin.name | html %]</strong> > <span class="badge text-bg-warning">ERRORS</span> >- </td> >- [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %] >- <td colspan="8">Error found whilst attempting to load plugin</td> >- [% ELSE %] >- <td colspan="8">Error found whilst attempting to load plugin</td> > [% END %] >- </tr> >- [% ELSE %] >- <tr> >- <td> >- <strong>[% plugin.metadata.name | html %]</strong> >- </td> >+ </td> >+ [% UNLESS plugin.error %] > <td> > [% plugin.metadata.description | html %] > >@@ -199,89 +192,93 @@ > <div class="alert alert-warning"> Warning: This plugin was written for an older version of Koha. Use at your own risk. </div> > [% END %] > </td> >- <td>[% plugin.metadata.author | html %]</td> >- <td>[% plugin.metadata.version | html %]</td> >- <td>[% plugin.metadata.minimum_version | html %]</td> >- <td>[% plugin.metadata.maximum_version | html %]</td> >- <td>[% plugin.metadata.date_updated | $KohaDates %]</td> >+ [% ELSE %] > <td> >- [% IF ( plugin.is_enabled ) %] >- <span class="badge text-bg-success">Enabled</span> >- [% ELSE %] >- <span class="badge text-bg-warning">Disabled</span> >- [% END %] >+ <span class="badge text-bg-warning">Error found whilst attempting to load plugin</span> > </td> >- [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %] >- <td class="actions"> >- <div class="btn-group dropup"> >- <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a> >- <ul class="dropdown-menu" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]"> >- [% IF ( CAN_user_plugins_report ) %] >- [% IF plugin.can('report') %] >- <li >- ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=report"><i class="fa fa-table fa-fw"></i> Run report</a></li >- > >- [% END %] >+ [% END %] >+ <td>[% plugin.metadata.author | html %]</td> >+ <td>[% plugin.metadata.version | html %]</td> >+ <td>[% plugin.metadata.minimum_version | html %]</td> >+ <td>[% plugin.metadata.maximum_version | html %]</td> >+ <td>[% plugin.metadata.date_updated | $KohaDates %]</td> >+ <td> >+ [% IF ( plugin.is_enabled ) %] >+ <span class="badge text-bg-success">Enabled</span> >+ [% ELSE %] >+ <span class="badge text-bg-warning">Disabled</span> >+ [% END %] >+ </td> >+ [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %] >+ <td class="actions"> >+ <div class="btn-group dropup"> >+ <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a> >+ <ul class="dropdown-menu" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]"> >+ [% IF ( CAN_user_plugins_report ) %] >+ [% IF plugin.can('report') %] >+ <li >+ ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=report"><i class="fa fa-table fa-fw"></i> Run report</a></li >+ > > [% END %] >+ [% END %] > >- [% IF ( CAN_user_plugins_tool ) %] >- [% IF plugin.can('tool') %] >- <li >- ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=tool"><i class="fa fa-wrench fa-fw"></i> Run tool</a></li >- > >- [% END %] >+ [% IF ( CAN_user_plugins_tool ) %] >+ [% IF plugin.can('tool') %] >+ <li >+ ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=tool"><i class="fa fa-wrench fa-fw"></i> Run tool</a></li >+ > > [% END %] >+ [% END %] > >- [% IF ( CAN_user_plugins_admin ) %] >- [% IF plugin.can('admin') %] >- <li >- ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=admin"><i class="fa fa-wrench fa-fw"></i> Run admin tool</a></li >- > >- [% END %] >+ [% IF ( CAN_user_plugins_admin ) %] >+ [% IF plugin.can('admin') %] >+ <li >+ ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=admin"><i class="fa fa-wrench fa-fw"></i> Run admin tool</a></li >+ > > [% END %] >+ [% END %] > >- [% IF ( CAN_user_plugins_configure ) %] >- [% IF plugin.can('configure') %] >- <li >- ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=configure"><i class="fa fa-cog fa-fw"></i> Configure</a></li >- > >- [% END %] >+ [% IF ( CAN_user_plugins_configure ) %] >+ [% IF plugin.can('configure') %] >+ <li >+ ><a class="dropdown-item" href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=configure"><i class="fa fa-cog fa-fw"></i> Configure</a></li >+ > > [% END %] >- [% IF ( CAN_user_plugins_manage ) %] >+ [% END %] >+ [% IF ( CAN_user_plugins_manage ) %] >+ <li >+ ><a >+ class="dropdown-item uninstall_plugin" >+ data-plugin-name="[% plugin.metadata.name | html %]" >+ href="/cgi-bin/koha/plugins/plugins-uninstall.pl?class=[% plugin.class | html %]" >+ ><i class="fa fa-trash-can fa-fw"></i> Uninstall</a >+ ></li >+ > >+ [% IF ( plugin.is_enabled ) %] > <li > ><a >- class="dropdown-item uninstall_plugin" >+ class="dropdown-item enable_plugin" > data-plugin-name="[% plugin.metadata.name | html %]" >- href="/cgi-bin/koha/plugins/plugins-uninstall.pl?class=[% plugin.class | html %]" >- ><i class="fa fa-trash-can fa-fw"></i> Uninstall</a >+ href="/cgi-bin/koha/plugins/plugins-enable.pl?class=[% plugin.class | html %]&method=disable" >+ ><i class="fa fa-pause fa-fw"></i> Disable</a >+ ></li >+ > >+ [% ELSE %] >+ <li >+ ><a >+ class="dropdown-item enable_plugin" >+ data-plugin-name="[% plugin.metadata.name | html %]" >+ href="/cgi-bin/koha/plugins/plugins-enable.pl?class=[% plugin.class | html %]&method=enable" >+ ><i class="fa fa-play fa-fw"></i> Enable</a > ></li > > >- [% IF ( plugin.is_enabled ) %] >- <li >- ><a >- class="dropdown-item enable_plugin" >- data-plugin-name="[% plugin.metadata.name | html %]" >- href="/cgi-bin/koha/plugins/plugins-enable.pl?class=[% plugin.class | html %]&method=disable" >- ><i class="fa fa-pause fa-fw"></i> Disable</a >- ></li >- > >- [% ELSE %] >- <li >- ><a >- class="dropdown-item enable_plugin" >- data-plugin-name="[% plugin.metadata.name | html %]" >- href="/cgi-bin/koha/plugins/plugins-enable.pl?class=[% plugin.class | html %]&method=enable" >- ><i class="fa fa-play fa-fw"></i> Enable</a >- ></li >- > >- [% END %] > [% END %] >- </ul> >- </div> >- </td> >- [% END %] >- </tr> >- [% END %] >+ [% END %] >+ </ul> >+ </div> >+ </td> >+ [% END %] >+ </tr> > [% END %] > </table> </div > ><!-- /.page-section --> >-- >2.43.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 41476
: 190616