diff --git a/src/Form/VCardSettingsForm.php b/src/Form/VCardSettingsForm.php index 783f29c..28a117e 100644 --- a/src/Form/VCardSettingsForm.php +++ b/src/Form/VCardSettingsForm.php @@ -31,7 +31,7 @@ class VCardSettingsForm extends ConfigFormBase { public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('vcard.settings'); if (!_vcard_init()) { - drupal_set_message($this->t('The PEAR package Contact_Vcard_Build (required by vcard.module) has not been installed properly, please read INSTALL.txt.'), 'warning'); + $this->messenger()->addWarning($this->t('The PEAR package Contact_Vcard_Build (required by vcard.module) has not been installed properly, please read INSTALL.txt.')); } $form['display'] = [ @@ -94,7 +94,7 @@ class VCardSettingsForm extends ConfigFormBase { $display_settings_hcard = $form_state->getValue('vcard_display_profile_hcard'); $config->set('vcard_display_profile_hcard', $display_settings_hcard)->save(); - drupal_set_message($this->t('Configurations have been saved.')); + $this->messenger()->addStatus($this->t('Configurations have been saved.')); } } diff --git a/vcard.info.yml b/vcard.info.yml index 334ef8f..474ab7c 100755 --- a/vcard.info.yml +++ b/vcard.info.yml @@ -2,4 +2,5 @@ name: vCard type: module description: 'Allows vcard export of user data.' core: 8.x +core_version_requirement: ^8 || ^9 configure: vcard.settings diff --git a/vcard.module b/vcard.module index caa8cd4..baee594 100644 --- a/vcard.module +++ b/vcard.module @@ -253,21 +253,21 @@ function vcard_get($user) { $vcard->addParam('ENCODING', '8BIT'); } else { - $vcard->setName(HTML::escape($name), '', '', '', ''); + $vcard->setName(Html::escape($name), '', '', '', ''); $vcard->addParam('ENCODING', '8BIT'); - $vcard->setFormattedname(HTML::escape($name)); + $vcard->setFormattedname(Html::escape($name)); $vcard->addParam('ENCODING', '8BIT'); } // Email. if (!empty($user->get('mail'))) { $mail = $user->get('mail')->value; - $vcard->addEmail(HTML::escape($mail)); + $vcard->addEmail(Html::escape($mail)); $vcard->addParam('ENCODING', '8BIT'); } // Nickname. - $vcard->addNickname(HTML::escape($name)); + $vcard->addNickname(Html::escape($name)); $vcard->addParam('ENCODING', '8BIT'); // Birthday.