If these extra fields where not set it would throw an error: 
PHP Fatal error:  Uncaught Exception: Element 'extra_mail_notify_invitation' does not exist in HTML_QuickForm::removeElement()

$content['form']->removeElement('extra_mail_notify_invitation');
$content['form']->removeElement('extra_mail_notify_message');
$content['form']->removeElement('extra_mail_notify_group_message');
pull/3135/head
SpaceCabbie 6 years ago committed by GitHub
parent efee935440
commit 9bcc4e0933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      custompages/registration-dist.php

@ -12,10 +12,17 @@ require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
require_once __DIR__.'/language.php';
/**
* Removes some unwanted elementend of the form object.
* 03-26-2020 Added check if element exist.
*/
$content['form']->removeElement('extra_mail_notify_invitation');
$content['form']->removeElement('extra_mail_notify_message');
$content['form']->removeElement('extra_mail_notify_group_message');
if (isset($content['form']->_elementIndex['extra_mail_notify_invitation'])) {
$content['form']->removeElement('extra_mail_notify_invitation');
}
if (isset($content['form']->_elementIndex['extra_mail_notify_message'])) {
$content['form']->removeElement('extra_mail_notify_message');
}
if (isset($content['form']->_elementIndex['extra_mail_notify_group_message'])) {
$content['form']->removeElement('extra_mail_notify_group_message');
}
$content['form']->removeElement('official_code');
$content['form']->removeElement('phone');
$content['form']->removeElement('submit');

Loading…
Cancel
Save