Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #2817: Field about for profiles #2914

Merged
merged 4 commits into from Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Backend/Modules/Profiles/Actions/Add.php
Expand Up @@ -91,6 +91,7 @@ private function loadForm(): void
$this->form->addDropdown('month', $months);
$this->form->addDropdown('year', array_combine($years, $years));
$this->form->addDropdown('country', Intl::getRegionBundle()->getCountryNames(BL::getInterfaceLanguage()));
$this->form->addEditor('about');

// set default elements dropdowns
$this->form->getField('gender')->setDefaultElement('');
Expand Down Expand Up @@ -119,6 +120,7 @@ private function validateForm(): void
$ddmMonth = $this->form->getField('month');
$ddmYear = $this->form->getField('year');
$ddmCountry = $this->form->getField('country');
$txtAbout = $this->form->getField('about');

// email filled in?
if ($txtEmail->isFilled(BL::getError('EmailIsRequired'))) {
Expand Down Expand Up @@ -191,6 +193,7 @@ private function validateForm(): void
BackendProfilesModel::setSetting($this->id, 'birth_date', $birthDate);
BackendProfilesModel::setSetting($this->id, 'city', $txtCity->getValue());
BackendProfilesModel::setSetting($this->id, 'country', $ddmCountry->getValue());
BackendProfilesModel::setSetting($this->id, 'about', $txtAbout->getValue());

// notify values
$notifyValues = array_merge(
Expand Down
3 changes: 3 additions & 0 deletions src/Backend/Modules/Profiles/Actions/Edit.php
Expand Up @@ -116,6 +116,7 @@ private function loadForm(): void
Intl::getRegionBundle()->getCountryNames(BL::getInterfaceLanguage()),
BackendProfilesModel::getSetting($this->id, 'country')
);
$this->form->addEditor('about', BackendProfilesModel::getSetting($this->id, 'about'));

// set default elements dropdowns
$this->form->getField('gender')->setDefaultElement('');
Expand Down Expand Up @@ -213,6 +214,7 @@ private function validateForm(): void
$ddmMonth = $this->form->getField('month');
$ddmYear = $this->form->getField('year');
$ddmCountry = $this->form->getField('country');
$txtAbout = $this->form->getField('about');

// email filled in?
if ($chkNewEmail->isChecked() && $txtEmail->isFilled(BL::getError('EmailIsRequired'))) {
Expand Down Expand Up @@ -306,6 +308,7 @@ private function validateForm(): void
BackendProfilesModel::setSetting($this->id, 'birth_date', $birthDate);
BackendProfilesModel::setSetting($this->id, 'city', $txtCity->getValue());
BackendProfilesModel::setSetting($this->id, 'country', $ddmCountry->getValue());
BackendProfilesModel::setSetting($this->id, 'about', $txtAbout->getValue());

$displayName = (isset($values['display_name'])) ?
$values['display_name'] : $this->profile['display_name'];
Expand Down