View Issue Details

IDProjectCategoryView StatusLast Update
0026142mantisbtplug-inspublic2019-09-15 15:44
Reporterdregad Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Target Version2.23.0 
Summary0026142: Improve handling of invalid / incorrectly installed plugins
Description

When installing plugins in a MantisBT instance, or when moving / upgrading MantisBT there are several things that can go wrong

  • The case of the directory in which the plugin is installed does not exactly match the plugin's name
  • A registered plugin is no longer present on disk
  • The plugin code could be invalid
  • etc.

Currently, some of these scenarios are not detected by Core, making it difficult for the administrator to figure out what is wrong (or that something is wrong to begin with).

If there are any invalid plugins, the Manage Plugins page should detect them and present the administrator with a list, allowing them to fix the problem.

TagsNo tags attached.

Relationships

parent of 0017487 assigneddregad Validate plugin folder name and name match during setup 
parent of 0026143 assigneddregad Admin checks should detect invalid / incorrectly installed plugins 
Not all the children of this issue are yet resolved or closed.

Activities

dregad

dregad

2019-09-15 15:07

developer   ~0062808

Last edited: 2019-09-15 15:10

View 3 revisions

Consider the following scenario: a MantisBT instance with a successfully installed 3rd party plugin (e.g. Announce).

  • Migrate MantisBT to a new location (fresh install, copying the database -> the plugin was not migrated)
  • Install a new plugin (e.g. Snippets), but create the directory with wrong case (snippets)
  • For the sake of testing, throw in a couple of invalid plugins (with undefined name / version properties in the plugin's base class)

Contents of plugin directory:

$ ls -1 plugins
Gravatar
MantisCoreFormatting
MantisGraph
snippets
TestInvalidNoName
TestInvalidNoVersion
Web.config
XmlImportExport

Contents of _mantis_plugintable:

mysql> select * from mantis_plugin_table;
+----------------------+---------+-----------+----------+
| basename             | enabled | protected | priority |
+----------------------+---------+-----------+----------+
| MantisCoreFormatting |       1 |         0 |        3 |
| Gravatar             |       1 |         0 |        3 |
| Announce             |       1 |         0 |        3 |
+----------------------+---------+-----------+----------+
3 rows in set (0.00 sec)

None of these errors are visible on the GUI (except for possibly missing menu items, etc. as the plugins are not registered) as shown on the screenshot below.

dregad

dregad

2019-09-15 15:38

developer   ~0062809

Last edited: 2019-09-15 15:44

View 2 revisions

PR https://github.com/mantisbt/mantisbt/pull/1565

See attached screenshots showing how the test scenario looks like with the new code, in

  • Manage Plugins Page
  • Admin Checks

Note that if there are no invalid or missing plugins, the section is not displayed.

new_admin_checks.png (39,421 bytes)   
new_admin_checks.png (39,421 bytes)   
dregad

dregad

2019-09-15 15:42

developer   ~0062810

For the record, here are the 2 dummy invalid plugins I used for testing.

Issue History

Date Modified Username Field Change
2019-09-15 14:42 dregad New Issue
2019-09-15 14:42 dregad Status new => assigned
2019-09-15 14:42 dregad Assigned To => dregad
2019-09-15 14:52 dregad Relationship added parent of 0017487
2019-09-15 15:07 dregad Note Added: 0062808
2019-09-15 15:07 dregad File Added: invalid_plugins_not_detected.png
2019-09-15 15:08 dregad Note Edited: 0062808 View Revisions
2019-09-15 15:10 dregad Note Edited: 0062808 View Revisions
2019-09-15 15:27 dregad Issue cloned: 0026143
2019-09-15 15:27 dregad Relationship added parent of 0026143
2019-09-15 15:38 dregad Note Added: 0062809
2019-09-15 15:38 dregad File Added: new_missing_or_invalid_plugins_section.png
2019-09-15 15:38 dregad File Added: new_admin_checks.png
2019-09-15 15:42 dregad Note Added: 0062810
2019-09-15 15:42 dregad File Added: TestInvalidPlugins.tar.gz
2019-09-15 15:44 dregad Note Edited: 0062809 View Revisions