[development] Field invisible
Muzaffer Tolga Ozses
tolga at ozses.net
Wed Feb 4 07:35:32 UTC 2015
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20150204/040f8ad5/attachment.html
More information about the development
mailing list