From 42edaba56f11b2fbe8b90747b303ba6199a091c7 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Mon, 26 Feb 2024 17:47:31 +0100 Subject: [PATCH] MDL-80949 mod_data: Remove unused Allow autolink param for text field --- mod/data/db/upgrade.php | 12 ++++++++++++ mod/data/field/text/mod.html | 4 ---- mod/data/lang/en/data.php | 4 +++- mod/data/lang/en/deprecated.txt | 1 + mod/data/tests/generator/lib.php | 2 +- mod/data/version.php | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index efa615abe6c..32718e31e2e 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -67,5 +67,17 @@ function xmldb_data_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2023100901) { + // Clean param1 for "text" fields because it was unused. + $DB->execute( + "UPDATE {data_fields} + SET param1 = '' + WHERE type = 'text'" + ); + + // Data savepoint reached. + upgrade_mod_savepoint(true, 2023100901, 'data'); + } + return true; } diff --git a/mod/data/field/text/mod.html b/mod/data/field/text/mod.html index 597e7639a09..10962da8df2 100644 --- a/mod/data/field/text/mod.html +++ b/mod/data/field/text/mod.html @@ -11,8 +11,4 @@ field->required?"checked=\"checked\"":""); ?>/> - - - field->param1) {echo 'checked="checked"';} ?> value="1" /> - diff --git a/mod/data/lang/en/data.php b/mod/data/lang/en/data.php index 70205abf1bb..caeee04f10c 100644 --- a/mod/data/lang/en/data.php +++ b/mod/data/lang/en/data.php @@ -170,7 +170,6 @@ $string['exportownentries'] = 'Export your own entries only? ({$a->mine}/{$a->al $string['exportpreset'] = 'Export preset'; $string['failedpresetdelete'] = 'An error was encountered while trying to delete the preset.'; $string['fieldadded'] = 'Field added'; -$string['fieldallowautolink'] = 'Allow autolink'; $string['fielddeleted'] = 'Field deleted'; $string['fielddelimiter'] = 'Field separator'; $string['fielddescription'] = 'Field description'; @@ -489,3 +488,6 @@ $string['fieldids'] = 'Field ids'; // Deprecated since Moodle 4.3. $string['completionentries'] = 'Require entries'; + +// Deprecated since Moodle 4.4. +$string['fieldallowautolink'] = 'Allow autolink'; diff --git a/mod/data/lang/en/deprecated.txt b/mod/data/lang/en/deprecated.txt index 2e5d4e50bc2..0c52e751bba 100644 --- a/mod/data/lang/en/deprecated.txt +++ b/mod/data/lang/en/deprecated.txt @@ -9,3 +9,4 @@ addentries,mod_data todatabase,mod_data fieldids,mod_data completionentries,mod_data +fieldallowautolink,mod_data diff --git a/mod/data/tests/generator/lib.php b/mod/data/tests/generator/lib.php index 559f0f0b780..eec22b7e017 100644 --- a/mod/data/tests/generator/lib.php +++ b/mod/data/tests/generator/lib.php @@ -134,7 +134,7 @@ class mod_data_generator extends testing_module_generator { $record['param1'] = implode("\n", array('menu1', 'menu2', 'menu3', 'menu4')); } else if ($record['type'] == 'multimenu') { $record['param1'] = implode("\n", array('multimenu1', 'multimenu2', 'multimenu3', 'multimenu4')); - } else if (($record['type'] === 'text') || ($record['type'] === 'url')) { + } else if ($record['type'] === 'url') { $record['param1'] = 1; } else if ($record['type'] == 'latlong') { $record['param1'] = 'Google Maps'; diff --git a/mod/data/version.php b/mod/data/version.php index 4ba8f64acf7..bc43b2baee1 100644 --- a/mod/data/version.php +++ b/mod/data/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023100900; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2023100901; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2023100400; // Requires this Moodle version. $plugin->component = 'mod_data'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; -- 2.43.0