[development] Field invisible

Erik Stielstra info at erikstielstra.nl
Wed Feb 4 08:52:17 UTC 2015


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 <tolga at ozses.net> wrote:
> 
> Hi,
> 
> 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.
> 
> <?php
> /**
>  * Implements hook_install().
>  */
> function tckn_kontrol_install() {
>   $field = array(
>     'field_name' => 'field_tckn',
>     'type' => 'text',
>     'settings' => array(
>       'max_length' => 11,
>     ),
>   );
>   $instance = array(
>     'field_name' => 'field_tckn',
>     'entity_type' => 'user',
>     'bundle' => 'user',
>     'required' => TRUE,
>     'label' => t('TCKN'),
>     'description' => t('Enter your TCKN.'),
>     'settings' => array(
>       'user_register_form' => TRUE,
>     ),
>     'display' => array(
>       'default' => array(
>         'label' => 'above',
>         'type' => 'text_textfield',
>       ),
>     ),
>     'widget' => array(
>       'settings' => array(
>         'size' => 12,
>       ),
>     ),
>   );
>   field_create_field($field);
>   field_create_instance($instance);
> }
> function tckn_kontrol_uninstall() {
>   $instance = array(
>     'field_name' => 'field_tckn',
>     'bundle' => 'user',
>     );
>   field_delete_field($instance['field_name']);
> }
> 
> ​Thank you in advance for replying.​
> 
> -- 
> mto



More information about the development mailing list