@@ -874,7 +874,7 @@ function xmldb_zoom_upgrade($oldversion) {
874
874
$ table = new xmldb_table ('zoom ' );
875
875
876
876
// Define and conditionally add field registration.
877
- $ field = new xmldb_field ('registration ' , XMLDB_TYPE_INTEGER , '1 ' , null , null , null , null , 'option_auto_recording ' );
877
+ $ field = new xmldb_field ('registration ' , XMLDB_TYPE_INTEGER , '1 ' , null , XMLDB_NOTNULL , null , ' 2 ' , 'option_auto_recording ' );
878
878
if (!$ dbman ->field_exists ($ table , $ field )) {
879
879
$ dbman ->add_field ($ table , $ field );
880
880
}
@@ -933,5 +933,20 @@ function xmldb_zoom_upgrade($oldversion) {
933
933
upgrade_mod_savepoint (true , 2023111600 , 'zoom ' );
934
934
}
935
935
936
+ if ($ oldversion < 2024012500 ) {
937
+ // Version 5.1.0 incorrectly upgraded the zoom table's registration field. It should not be null and should default to 2.
938
+ $ table = new xmldb_table ('zoom ' );
939
+ $ field = new xmldb_field ('registration ' , XMLDB_TYPE_INTEGER , '1 ' , null , XMLDB_NOTNULL , null , '2 ' , 'option_auto_recording ' );
940
+
941
+ // Launch change of nullability for field registration.
942
+ $ dbman ->change_field_notnull ($ table , $ field );
943
+
944
+ // Launch change of default for field registration.
945
+ $ dbman ->change_field_default ($ table , $ field );
946
+
947
+ // Zoom savepoint reached.
948
+ upgrade_mod_savepoint (true , 2024012500 , 'zoom ' );
949
+ }
950
+
936
951
return true ;
937
952
}
0 commit comments