@@ -139,7 +139,6 @@ function xmldb_local_adele_upgrade($oldversion) {
139139 // Adele savepoint reached.
140140 upgrade_plugin_savepoint (true , 2024082905 , 'local ' , 'adele ' );
141141 }
142-
143142 if ($ oldversion < 2025081200 ) {
144143 // Define the new "Adele Assistant" role properties.
145144 $ name = 'Adele Assistant ' ;
@@ -196,22 +195,6 @@ function xmldb_local_adele_upgrade($oldversion) {
196195 // Update savepoint to mark the successful upgrade.
197196 upgrade_plugin_savepoint (true , 2025081200 , 'local ' , 'adele ' );
198197 }
199-
200- if ($ oldversion < 2026071500 ) {
201- // Ticket #482: the local/adele:teacheredit capability gained the manager
202- // archetype so a course Manager operates a learning path like an editing
203- // teacher. Archetype defaults only apply to fresh installs, so grant it to
204- // existing manager roles here too. Do not overwrite any explicit admin
205- // override (overwrite = false).
206- $ systemcontext = \context_system::instance ();
207- foreach (get_archetype_roles ('manager ' ) as $ role ) {
208- assign_capability ('local/adele:teacheredit ' , CAP_ALLOW , $ role ->id , $ systemcontext ->id , false );
209- }
210-
211- // Adele savepoint reached.
212- upgrade_plugin_savepoint (true , 2026071500 , 'local ' , 'adele ' );
213- }
214-
215198 if ($ oldversion < 2026061800 ) {
216199 // Ticket #431: the local/adele:teacheredit capability gained the editingteacher
217200 // archetype so editing-teachers can operate master conditions without the
@@ -227,6 +210,20 @@ function xmldb_local_adele_upgrade($oldversion) {
227210 upgrade_plugin_savepoint (true , 2026061800 , 'local ' , 'adele ' );
228211 }
229212
213+ if ($ oldversion < 2026071500 ) {
214+ // Ticket #482: the local/adele:teacheredit capability gained the manager
215+ // archetype so a course Manager operates a learning path like an editing
216+ // teacher. Archetype defaults only apply to fresh installs, so grant it to
217+ // existing manager roles here too. Do not overwrite any explicit admin
218+ // override (overwrite = false).
219+ $ systemcontext = \context_system::instance ();
220+ foreach (get_archetype_roles ('manager ' ) as $ role ) {
221+ assign_capability ('local/adele:teacheredit ' , CAP_ALLOW , $ role ->id , $ systemcontext ->id , false );
222+ }
223+
224+ // Adele savepoint reached.
225+ upgrade_plugin_savepoint (true , 2026071500 , 'local ' , 'adele ' );
226+ }
230227 if ($ oldversion < 2026072200 ) {
231228 // The course_completed observer now resolves the affected student via
232229 // relateduserid instead of the acting user (userid). Courses that were
@@ -271,5 +268,6 @@ function xmldb_local_adele_upgrade($oldversion) {
271268
272269 upgrade_plugin_savepoint (true , 2026072203 , 'local ' , 'adele ' );
273270 }
271+
274272 return true ;
275273}
0 commit comments