@@ -46,22 +46,28 @@ public function initialize()
46
46
$ this ->helper ->register ('newTaskHelper ' , '\Kanboard\Plugin\Group_assign\Helper\NewTaskHelper ' );
47
47
$ this ->helper ->register ('sizeAvatarHelperExtend ' , '\Kanboard\Plugin\Group_assign\Helper\SizeAvatarHelperExtend ' );
48
48
49
-
50
49
//Models and backward compatibility
50
+ $ load_new_classes = true ;
51
51
$ applications_version = str_replace ('v ' , '' , APP_VERSION );
52
- if ((strpos (APP_VERSION , 'master ' ) !== false || strpos (APP_VERSION , 'main ' ) !== false ) && file_exists ('ChangeLog ' )) {
53
- $ applications_version = trim (file_get_contents ('ChangeLog ' , false , null , 8 , 6 ), ' ' );
52
+
53
+ if (strpos (APP_VERSION , 'master ' ) !== false || strpos (APP_VERSION , 'main ' ) !== false ) {
54
+ if (file_exists ('ChangeLog ' )) {
55
+ $ applications_version = trim (file_get_contents ('ChangeLog ' , false , null , 8 , 6 ), ' ' );
56
+ $ clean_appversion = preg_replace ('/\s+/ ' , '' , $ applications_version );
57
+ $ load_new_classes = version_compare ($ clean_appversion , '1.2.6 ' , '< ' );
58
+ }
59
+ } else {
60
+ $ load_new_classes = version_compare ($ applications_version , '1.2.5 ' , '> ' );
54
61
}
55
- $ clean_appversion = preg_replace ('/\s+/ ' , '' , $ applications_version );
56
62
57
- if (version_compare ( $ clean_appversion , ' 1.2.6 ' , ' < ' ) ) {
63
+ if ($ load_new_classes ) {
58
64
if (file_exists ('plugins/MetaMagik ' )) {
59
65
$ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
60
- return new OldMetaMagikSubquery ($ c );
66
+ return new NewMetaMagikSubquery ($ c );
61
67
});
62
68
} else {
63
69
$ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
64
- return new OldTaskFinderModel ($ c );
70
+ return new NewTaskFinderModel ($ c );
65
71
});
66
72
}
67
73
$ this ->container ['taskDuplicationModel ' ] = $ this ->container ->factory (function ($ c ) {
@@ -79,11 +85,11 @@ public function initialize()
79
85
} else {
80
86
if (file_exists ('plugins/MetaMagik ' )) {
81
87
$ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
82
- return new NewMetaMagikSubquery ($ c );
88
+ return new OldMetaMagikSubquery ($ c );
83
89
});
84
90
} else {
85
91
$ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
86
- return new NewTaskFinderModel ($ c );
92
+ return new OldTaskFinderModel ($ c );
87
93
});
88
94
}
89
95
$ this ->container ['taskDuplicationModel ' ] = $ this ->container ->factory (function ($ c ) {
0 commit comments