From 04645f4e9b2cb0721afab24632b4da31b6ba654e Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 6 May 2019 19:16:39 +0200 Subject: [PATCH] MDL-65187 core_hub: send more important info first to moodle.net Rumor has it that some browsers may truncate the GET request to 2000 characters, make sure that all important info is sent first Everything else will be updated on the first registration update request. --- lib/classes/hub/registration.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/classes/hub/registration.php b/lib/classes/hub/registration.php index 25867914b06..3807d9c4655 100644 --- a/lib/classes/hub/registration.php +++ b/lib/classes/hub/registration.php @@ -40,11 +40,11 @@ use html_writer; */ class registration { - /** @var Fields used in a site registration form. + /** @var array Fields used in a site registration form. * IMPORTANT: any new fields with non-empty defaults have to be added to CONFIRM_NEW_FIELDS */ - const FORM_FIELDS = ['name', 'description', 'contactname', 'contactemail', 'contactphone', 'imageurl', 'privacy', 'street', - 'regioncode', 'countrycode', 'geolocation', 'contactable', 'emailalert', 'emailalertemail', 'commnews', 'commnewsemail', - 'language', 'policyagreed']; + const FORM_FIELDS = ['policyagreed', 'language', 'countrycode', 'privacy', + 'contactemail', 'contactable', 'emailalert', 'emailalertemail', 'commnews', 'commnewsemail', + 'contactname', 'name', 'description', 'imageurl', 'contactphone', 'regioncode', 'geolocation', 'street']; /** @var List of new FORM_FIELDS or siteinfo fields added indexed by the version when they were added. * If site was already registered, admin will be promted to confirm new registration data manually. Until registration is manually confirmed, @@ -397,8 +397,7 @@ class registration { self::$registration = null; } - $params = self::get_site_info(); - $params['token'] = $hub->token; + $params = ['token' => $hub->token] + self::get_site_info(); $SESSION->registrationredirect = $returnurl; redirect(new moodle_url(HUB_MOODLEORGHUBURL . '/local/hub/siteregistration.php', $params));