View Issue Details

IDProjectCategoryView StatusLast Update
0022171mantisbtplug-inspublic2017-01-31 04:02
Reportercproensa Assigned Todregad  
PriorityurgentSeverityblockReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.0.0 
Target Version2.1.0Fixed in Version2.1.0 
Summary0022171: Redefine plugin version requirements

With the new version scheme of major.minor.patch,
plugin requeriments on mantis core version needs to be redefined.
Currently, a plugin requiring 2.0 is only valid for <2.1
Should be defined as valid for <3.0 (less than next major version)

TagsNo tags attached.


has duplicate 0022196 closeddregad Changing version to 2.1.0-dev breaks 2.0.0 plugins 




2017-01-11 18:31

developer   ~0055062

You mean changing the logic in plugin API ?



2017-01-11 18:40

developer   ~0055064

I assume @cproensa does not want to change the logic but means just replacing the dependency to something like
'MantisCore' => '2.0, &lt; 3.0',



2017-01-11 19:01

developer   ~0055065

Actually, i mean changing the logic in plugin api
If i recall correctly, requiring "MantisCore => 2.0" will be valid for 2.0.0 through 2.0.999...
With the new version releases, it should be changed to be valid for 2.0 through 2.999...

MantisCore => 2.0, < 3.0

I haven't tested, but i suspect that would not work, if it would resolve to >=2.0 AND <2.1 OR >=2.9 AND <3.0



2017-01-11 19:57

developer   ~0055068

If i recall correctly, requiring MantisCore => 2.0 will be valid for 2.0.0 through 2.0.999

@cproensa You are correct, see

With the new version releases, it should be changed to be valid for 2.0 through 2.999...

I think it makes sense to change this as you propose. Of course this implies that we'd have to defer any plugin API breaking change to the next major version (which is how it should be IMO).



2017-01-12 03:55

developer   ~0055074

Repeating comment posted in response to vboctor's question in

Can we have the dependency to be > 2.0.0 rather than exactly 2.0.0?

It is. The problem is that the plugin API silently adds a &lt; x.y+1 so the effective version requirement is (>=) 2.0.0, &lt; 2.1 in this case. This was added due to BC issues between 1.2 and 1.3. As per discussion in in 0022171, we should change the logic so the plugin API does &lt; x+1, reflecting the fact that BC changes should on principle only happen in major releases.



2017-01-15 19:03

developer   ~0055138


Related Changesets

MantisBT: master cab8a96e

2017-01-15 10:48:18


Details Diff
Add Plugin API tests covering plugin_dependency()

An initial series of test to execute known scenarios, including the case
from issue 0022171.
Affected Issues
mod - tests/Mantis/AllTests.php Diff File
add - tests/Mantis/PluginTest.php Diff File

MantisBT: master 574dfa29

2017-01-15 18:33:30


Details Diff
Fix MantisCore plugin dependencies

In issue 0017360, we introduced setting a default maximum version for
MantisCore to avoid compatibility issues by disabling plugins which have
not been updated for a new Mantis release, with a break on every minor
version (x.Y.z).

With 2.0 and the decision to only introduce breaking changes on major
versions (X.y.z), this code has to be changed.

Fixes 0022171
Affected Issues
0017360, 0022171
mod - core/plugin_api.php Diff File

MantisBT: master 1d96c88c

2017-01-25 10:51:10


Committer: GitHub Details Diff
Merge plugin requirements PR

Prevents plugins getting disabled when bumping MANTIS_VERSION to 2.1.x.
Fixes 0022171

Also contains the following changes and improvements:
- Add PHPUnit tests for plugin_dependency() function
- Refactor plugin_version_check() to use PHP's version_compare()
function instead of custom code
- Reset MANTIS_VERSION to 2.1.0-dev.
- Revert MantisCore version requirements in bundled plugins
- Fix PHP notice when specifying plugin authors as array, fixes 0022205
- align code with documentation
- Improved plugin documentation in Developers guide, fixes 0022206

Affected Issues
0022171, 0022205, 0022206
mod - core/constant_inc.php Diff File
mod - core/plugin_api.php Diff File
mod - docbook/Developers_Guide/en-US/Plugins_Building.xml Diff File
mod - docbook/Developers_Guide/en-US/Plugins_Building_Source.xml Diff File
mod - manage_plugin_page.php Diff File
mod - plugins/Gravatar/Gravatar.php Diff File
mod - plugins/MantisCoreFormatting/MantisCoreFormatting.php Diff File
mod - plugins/MantisGraph/MantisGraph.php Diff File
mod - plugins/XmlImportExport/XmlImportExport.php Diff File
mod - tests/Mantis/AllTests.php Diff File
add - tests/Mantis/PluginTest.php Diff File