DevHeads.net

Field invisible

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

​Thank you in advance for replying.​

Comments

Re: Field invisible

By Erik Stielstra at 02/04/2015 - 04:52

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

Re: Field invisible

By Tolga at 02/04/2015 - 05:15

Thank you Eric for replying,

Like I said, this started happening after I renamed the field. Could this
be why?

Re: Field invisible

By Erik Stielstra at 02/04/2015 - 07:15

Erik Stielstra

Re: Field invisible

By Tolga at 02/04/2015 - 07:16

Not the field label, field name.

Re: Field invisible

By Tolga at 02/05/2015 - 07:51

This is what happens when I re-install the module:

<a href="https://dl.dropboxusercontent.com/u/11918318/Screenshot%20from%202015-02-05%2013%3A47%3A42.png" title="https://dl.dropboxusercontent.com/u/11918318/Screenshot%20from%202015-02-05%2013%3A47%3A42.png">https://dl.dropboxusercontent.com/u/11918318/Screenshot%20from%202015-02...</a>

Re: Field invisible

By Erik Stielstra at 02/05/2015 - 08:02

As I said "I can not reproduce your problem” and what I can’t reproduce I can not fix.

I would go looking for working examples. You can try the examples module. It has a.o. an entity- and a field example module. You can also try to add a field via the interface and then export its code using features. That will give you some PHP-code that should almost be what you need to create a field programatically.

Erik Stielstra

Re: Field invisible

By Tolga at 02/05/2015 - 08:12

Okay, I got the issue; it was #access. I must have mis-read API docs where
I thought #access meant "hide it from those with no access".