1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 01:44:27 +02:00

MDL-82483 tag: update the max length constant to match schema.

This commit is contained in:
Paul Holden 2024-07-15 21:50:10 +01:00
parent 056f473a6e
commit 5d45fa48a9
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
2 changed files with 3 additions and 20 deletions

@ -389,16 +389,8 @@ define ('BLOG_COURSE_LEVEL', 3);
define ('BLOG_SITE_LEVEL', 4);
define ('BLOG_GLOBAL_LEVEL', 5);
// Tag constants.
/**
* To prevent problems with multibytes strings,Flag updating in nav not working on the review page. this should not exceed the
* length of "varchar(255) / 3 (bytes / utf-8 character) = 85".
* TODO: this is not correct, varchar(255) are 255 unicode chars ;-)
*
* @todo define(TAG_MAX_LENGTH) this is not correct, varchar(255) are 255 unicode chars ;-)
*/
define('TAG_MAX_LENGTH', 50);
/** The maximum length of a tag */
define('TAG_MAX_LENGTH', 255);
// Password policy constants.
define ('PASSWORD_LOWER', 'abcdefghijklmnopqrstuvwxyz');

@ -14,14 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package core_tag
* @category tag
* @copyright 2007 Luiz Cruz <luiz.laydner@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
@ -57,8 +49,7 @@ class tag_edit_form extends moodleform {
$systemcontext = context_system::instance();
if (has_capability('moodle/tag:manage', $systemcontext)) {
$mform->addElement('text', 'rawname', get_string('name', 'tag'),
'maxlength="'.TAG_MAX_LENGTH.'" size="'.TAG_MAX_LENGTH.'"');
$mform->addElement('text', 'rawname', get_string('name', 'tag'), ['maxlength' => TAG_MAX_LENGTH, 'size' => 50]);
$mform->setType('rawname', PARAM_TAG);
}