-1

I am trying to share user profile fields in a multi-site. In the settings.php I tried like this for users and its sharing the common users fields.

$databases = array (
        'default' =>
        array (
                'default' =>
                array (
                        'database' => 'db',
                        'username' => 'root',
                        'password' => 'password',
                        'host' => '170.10.40.150',
                        'port' => '',
                        'driver' => 'mysql',
                        //'prefix' => 'main_',
                        'prefix' => array(
                            'default'   => 'go_',
                            'users'     => 'main_',
                            'sessions'  => 'main_',
                            'role'      => 'main_',
                            'authmap'   => 'main_',
                        ),
                ),
        ),
);

Like wise if i try for user profile fields its not working.

$databases = array (
        'default' =>
        array (
                'default' =>
                array (
                        'database' => 'db',
                        'username' => 'root',
                        'password' => 'password',
                        'host' => '170.10.40.150',
                        'port' => '',
                        'driver' => 'mysql',
                        //'prefix' => 'main_',
                        'prefix' => array(
                            'default'   => 'go_',
                            'users'     => 'main_',
                            'sessions'  => 'main_',
                            'role'      => 'main_',
                            'authmap'   => 'main_',
                        'field_data_field_name_first' => 'main_',
                        'field_revision_field_name_first' => 'main_',
                        'field_data_field_generic_name' => 'main_',
                        'field_revision_field_generic_name' => 'main_'
                        ),
                ),
        ),
);

Any help will be really appreciated in knowing how to share profile user fields or what i am doing wrong.Thanks in advance.

1 Answer 1

1

First: remove from settings.php:

'field_data_field_name_first' => 'main_',
'field_revision_field_name_first' => 'main_',
'field_data_field_generic_name' => 'main_',
'field_revision_field_generic_name' => 'main_'

Second: create those fields in every site that will share them and attach them to user entities.

Third: Add again to settings.php:

'field_data_field_name_first' => 'main_',
'field_revision_field_name_first' => 'main_',
'field_data_field_generic_name' => 'main_',
'field_revision_field_generic_name' => 'main_'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.