Re: Field invisible

Erik Stielstra <[email protected]> Wed, 4 Feb 2015 09:52:17 +0100
Newsgroups gmane.comp.php.drupal.devel
Message-ID <[email protected]>
Hi mto,

I can not reproduce your problem. I copied the code in hello.install, =
renamed the function to hello_install(), enabled the module and the =
field was visible in the account form and the user page. Try you code =
again in on a D7 core, out of the box. Is must be some interaction with =
other code or styling.

Regards,
Erik Stielstra



> On 4 feb. 2015, at 08:35, Muzaffer Tolga Ozses <[email protected]> =
wrote:
>=20
> Hi,
>=20
> I've got the below code. After enabling the module, the field is seen =
disabled in /admin/config/people/accounts/display/full. Furthermore, =
even if I enable it, it is not on user account page, even though it is =
visible in dpm() output. This started happening after I changed the =
field name.
>=20
> <?php
> /**
>  * Implements hook_install().
>  */
> function tckn_kontrol_install() {
>   $field =3D array(
>     'field_name' =3D> 'field_tckn',
>     'type' =3D> 'text',
>     'settings' =3D> array(
>       'max_length' =3D> 11,
>     ),
>   );
>   $instance =3D array(
>     'field_name' =3D> 'field_tckn',
>     'entity_type' =3D> 'user',
>     'bundle' =3D> 'user',
>     'required' =3D> TRUE,
>     'label' =3D> t('TCKN'),
>     'description' =3D> t('Enter your TCKN.'),
>     'settings' =3D> array(
>       'user_register_form' =3D> TRUE,
>     ),
>     'display' =3D> array(
>       'default' =3D> array(
>         'label' =3D> 'above',
>         'type' =3D> 'text_textfield',
>       ),
>     ),
>     'widget' =3D> array(
>       'settings' =3D> array(
>         'size' =3D> 12,
>       ),
>     ),
>   );
>   field_create_field($field);
>   field_create_instance($instance);
> }
> function tckn_kontrol_uninstall() {
>   $instance =3D array(
>     'field_name' =3D> 'field_tckn',
>     'bundle' =3D> 'user',
>     );
>   field_delete_field($instance['field_name']);
> }
>=20
> =E2=80=8BThank you in advance for replying.=E2=80=8B
>=20
> --=20
> mto