From 66efa30293670641c4929ea150f1703933301b68 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 16 Mar 2021 17:43:35 +0100 Subject: [PATCH] MDL-71116 core_badges: Backpack URLs with more than 50 chars Backpack URLs (web and API) can have up to 255. However, the form for creating/editing them, doesn't allow URLs with more than 50 characters. This patch align limitation to DB value (255). --- badges/classes/form/external_backpack.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/badges/classes/form/external_backpack.php b/badges/classes/form/external_backpack.php index b5d10e06cad..3d632760df8 100644 --- a/badges/classes/form/external_backpack.php +++ b/badges/classes/form/external_backpack.php @@ -56,12 +56,12 @@ class external_backpack extends \moodleform { $mform->addElement('text', 'backpackapiurl', get_string('backpackapiurl', 'core_badges')); $mform->setType('backpackapiurl', PARAM_URL); $mform->addRule('backpackapiurl', null, 'required', null, 'client'); - $mform->addRule('backpackapiurl', get_string('maximumchars', '', 255), 'maxlength', 50, 'client'); + $mform->addRule('backpackapiurl', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $mform->addElement('text', 'backpackweburl', get_string('backpackweburl', 'core_badges')); $mform->setType('backpackweburl', PARAM_URL); $mform->addRule('backpackweburl', null, 'required', null, 'client'); - $mform->addRule('backpackweburl', get_string('maximumchars', '', 255), 'maxlength', 50, 'client'); + $mform->addRule('backpackweburl', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $apiversions = badges_get_badge_api_versions(); $mform->addElement('select', 'apiversion', get_string('apiversion', 'core_badges'), $apiversions);