Commit 562addaf authored by alexpott's avatar alexpott

Issue #2231495 by ACF, andrei.dincu: Array to string conversion error when...

Issue #2231495 by ACF, andrei.dincu: Array to string conversion error when trying to add a new user.
parent 068dd713
......@@ -208,7 +208,9 @@ function contact_form_user_form_alter(&$form, &$form_state) {
'#weight' => 5,
);
$account = $form_state['controller']->getEntity();
$account_data = !\Drupal::currentUser()->isAnonymous() ? \Drupal::service('user.data')->get('contact', $account->id(), 'enabled') : NULL;
if (!\Drupal::currentUser()->isAnonymous() && $account->id()) {
$account_data = \Drupal::service('user.data')->get('contact', $account->id(), 'enabled');
}
$form['contact']['contact'] = array(
'#type' => 'checkbox',
'#title' => t('Personal contact form'),
......
......@@ -19,7 +19,7 @@ class UserCreateTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('image');
public static $modules = array('image', 'contact');
public static function getInfo() {
return array(
......
Markdown is supported
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