Commit ea2e289b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '6034-applying-a-template-to-a-user-removes-the-mail-tab' into '1.4-dev'

Resolve "Applying a template to a user removes the mail tab"

See merge request fusiondirectory/fd!685
Showing with 6 additions and 4 deletions
+6 -4
...@@ -464,9 +464,9 @@ class templateHandling ...@@ -464,9 +464,9 @@ class templateHandling
* \param array $args the parameters * \param array $args the parameters
* \param mixed $str the string or array to apply the modifier on * \param mixed $str the string or array to apply the modifier on
* *
* \return array an array of possible values * \return iterable an array or iterable object of possible values
* */ * */
protected static function applyModifier (string $m, array $args, $str): array protected static function applyModifier (string $m, array $args, $str)
{ {
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8'); mb_regex_encoding('UTF-8');
......
...@@ -383,9 +383,11 @@ class user extends simplePlugin ...@@ -383,9 +383,11 @@ class user extends simplePlugin
if ($this->uid != '') { if ($this->uid != '') {
$skip[] = 'uid'; $skip[] = 'uid';
} }
parent::adapt_from_template($attrs, array_merge($skip, ['userPassword'])); parent::adapt_from_template($attrs, array_merge($skip, ['userPassword']));
if (isset($this->attrs['userPassword']) && !in_array('userPassword', $skip)) {
$this->userPassword = $this->attributesAccess['userPassword']->readUserPasswordValues($this->attrs['userPassword'][0], TRUE); if (isset($attrs['userPassword']) && !in_array('userPassword', $skip)) {
$this->userPassword = $this->attributesAccess['userPassword']->readUserPasswordValues($attrs['userPassword'][0], TRUE);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment