@@ -551,11 +551,11 @@ function xmldb_tool_lifecycle_upgrade($oldversion) {
551551 // Define field "delaytype" to be added to tool_lifecycle_delayed.
552552 $ table = new xmldb_table ('tool_lifecycle_delayed ' );
553553 $ field = new xmldb_field ('delaytype ' , XMLDB_TYPE_INTEGER , '5 ' , null , null , null , '0 ' , 'delayeduntil ' );
554- $ fieldoldname = new xmldb_field ('type ' );
554+ $ fieldold = new xmldb_field ('type ' , XMLDB_TYPE_INTEGER , ' 5 ' , null , null , null , ' 0 ' , ' delayeduntil ' );
555555
556556 // Rename if field 'type' exists.
557- if ($ dbman ->field_exists ($ table , $ fieldoldname )) {
558- $ dbman ->rename_field ($ table , $ fieldoldname , 'delaytype ' );
557+ if ($ dbman ->field_exists ($ table , $ fieldold )) {
558+ $ dbman ->rename_field ($ table , $ fieldold , 'delaytype ' );
559559 } else {
560560 // Conditionally add field "delaytype".
561561 if (!$ dbman ->field_exists ($ table , $ field )) {
@@ -567,10 +567,10 @@ function xmldb_tool_lifecycle_upgrade($oldversion) {
567567 $ table = new xmldb_table ('tool_lifecycle_delayed_workf ' );
568568
569569 // Rename if field 'type' is present.
570- if ($ dbman ->field_exists ($ table , $ fieldoldname )) {
571- $ dbman ->rename_field ($ table , $ fieldoldname , 'delaytype ' );
570+ if ($ dbman ->field_exists ($ table , $ fieldold )) {
571+ $ dbman ->rename_field ($ table , $ fieldold , 'delaytype ' );
572572 } else {
573- // Conditionally launch add field "delaytype".
573+ // Conditionally add field "delaytype".
574574 if (!$ dbman ->field_exists ($ table , $ field )) {
575575 $ dbman ->add_field ($ table , $ field );
576576 }
@@ -588,16 +588,16 @@ function xmldb_tool_lifecycle_upgrade($oldversion) {
588588 // Define field "includedelayedcourses" to be added to tool_lifecycle_workflow.
589589 $ field = new xmldb_field ('includedelayedcourses ' , XMLDB_TYPE_INTEGER , '5 ' , null , null , null , '0 ' , 'delayforallworkflows ' );
590590
591- // Conditionally launch add field "includedelayedcourses".
591+ // Conditionally add field "includedelayedcourses".
592592 if (!$ dbman ->field_exists ($ table , $ field )) {
593593 $ dbman ->add_field ($ table , $ field );
594594 }
595595
596- if ($ dir = core_component::get_plugin_directory ('lifecycletrigger ' , 'sitecourse ' )) {
596+ if (1 == 2 && $ dir = core_component::get_plugin_directory ('lifecycletrigger ' , 'sitecourse ' )) {
597597 tool_lifecycle_upgrade_removedir ($ dir );
598598 }
599599
600- if ($ dir = core_component::get_plugin_directory ('lifecycletrigger ' , 'delayedcourses ' )) {
600+ if (1 == 2 && $ dir = core_component::get_plugin_directory ('lifecycletrigger ' , 'delayedcourses ' )) {
601601 tool_lifecycle_upgrade_removedir ($ dir );
602602 }
603603
0 commit comments