Re: Field invisible
Muzaffer Tolga Ozses <[email protected]> Wed, 4 Feb 2015 11:15:31 +0200
| Newsgroups | gmane.comp.php.drupal.devel |
|---|---|
| Message-ID | <CAMAQ3nKY9E+YAuMieu925S43ELjYCt4YwBnE8rLws4B9M_8-bA@mail.gmail.com> |
--001a1134f0a2114d68050e3fa197 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you Eric for replying, Like I said, this started happening after I renamed the field. Could this be why? On 4 February 2015 at 10:52, Erik Stielstra <[email protected]> wrote: > 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: > > > > 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 =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']); > > } > > > > =E2=80=8BThank you in advance for replying.=E2=80=8B > > > > -- > > mto > > --=20 mto --001a1134f0a2114d68050e3fa197 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:courier = new,monospace">Thank you Eric for replying,</div><div class=3D"gmail_defaul= t" style=3D"font-family:courier new,monospace"><br></div><div class=3D"gmai= l_default" style=3D"font-family:courier new,monospace">Like I said, this st= arted happening after I renamed the field. Could this be why?</div></div><d= iv class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 4 February 2015 = at 10:52, Erik Stielstra <span dir=3D"ltr"><<a href=3D"mailto:info@eriks= tielstra.nl" target=3D"_blank">[email protected]</a>></span> wrote:<= br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left= :1px #ccc solid;padding-left:1ex">Hi mto,<br> <br> I can not reproduce your problem. I copied the code in hello.install, renam= ed the function to hello_install(), enabled the module and the field was vi= sible 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 stylin= g.<br> <br> Regards,<br> Erik Stielstra<br> <div class=3D"HOEnZb"><div class=3D"h5"><br> <br> <br> > On 4 feb. 2015, at 08:35, Muzaffer Tolga Ozses <<a href=3D"mailto:t= [email protected]">[email protected]</a>> wrote:<br> ><br> > Hi,<br> ><br> > I've got the below code. After enabling the module, the field is s= een disabled in /admin/config/people/accounts/display/full. Furthermore, ev= en if I enable it, it is not on user account page, even though it is visibl= e in dpm() output. This started happening after I changed the field name.<b= r> ><br> > <?php<br> > /**<br> >=C2=A0 * Implements hook_install().<br> >=C2=A0 */<br> > function tckn_kontrol_install() {<br> >=C2=A0 =C2=A0$field =3D array(<br> >=C2=A0 =C2=A0 =C2=A0'field_name' =3D> 'field_tckn',<= br> >=C2=A0 =C2=A0 =C2=A0'type' =3D> 'text',<br> >=C2=A0 =C2=A0 =C2=A0'settings' =3D> array(<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0'max_length' =3D> 11,<br> >=C2=A0 =C2=A0 =C2=A0),<br> >=C2=A0 =C2=A0);<br> >=C2=A0 =C2=A0$instance =3D array(<br> >=C2=A0 =C2=A0 =C2=A0'field_name' =3D> 'field_tckn',<= br> >=C2=A0 =C2=A0 =C2=A0'entity_type' =3D> 'user',<br> >=C2=A0 =C2=A0 =C2=A0'bundle' =3D> 'user',<br> >=C2=A0 =C2=A0 =C2=A0'required' =3D> TRUE,<br> >=C2=A0 =C2=A0 =C2=A0'label' =3D> t('TCKN'),<br> >=C2=A0 =C2=A0 =C2=A0'description' =3D> t('Enter your TCK= N.'),<br> >=C2=A0 =C2=A0 =C2=A0'settings' =3D> array(<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0'user_register_form' =3D> TRUE,<b= r> >=C2=A0 =C2=A0 =C2=A0),<br> >=C2=A0 =C2=A0 =C2=A0'display' =3D> array(<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0'default' =3D> array(<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'label' =3D> 'above= 9;,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'type' =3D> 'text_text= field',<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0),<br> >=C2=A0 =C2=A0 =C2=A0),<br> >=C2=A0 =C2=A0 =C2=A0'widget' =3D> array(<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0'settings' =3D> array(<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'size' =3D> 12,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0),<br> >=C2=A0 =C2=A0 =C2=A0),<br> >=C2=A0 =C2=A0);<br> >=C2=A0 =C2=A0field_create_field($field);<br> >=C2=A0 =C2=A0field_create_instance($instance);<br> > }<br> > function tckn_kontrol_uninstall() {<br> >=C2=A0 =C2=A0$instance =3D array(<br> >=C2=A0 =C2=A0 =C2=A0'field_name' =3D> 'field_tckn',<= br> >=C2=A0 =C2=A0 =C2=A0'bundle' =3D> 'user',<br> >=C2=A0 =C2=A0 =C2=A0);<br> >=C2=A0 =C2=A0field_delete_field($instance['field_name']);<br> > }<br> ><br> > =E2=80=8BThank you in advance for replying.=E2=80=8B<br> ><br> > --<br> > mto<br> <br> </div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>= <div class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr">mto</= div></div></div></div> </div> --001a1134f0a2114d68050e3fa197--