Hi... I'm trying to display a content type which has a text field with a value of 0 in it. However, Drupal seems to treat it as a null value and displays a blank value for this field. Anyone know how to display a 0 instead of showing a blank field?

Comments

mixxmac’s picture

Has anyone else had this problem in Drupal 7? It seems like a formatting thing that I should be able to change.

mukesh.agarwal17’s picture

Yes, I have faced a similar problem. The best way is to add a blank space before 0 :-) Or you could also have a number field instead of text field..

Mukesh Agarwal
www.innoraft.com

mixxmac’s picture

Thanks Mukesh. I just tried your suggestions. The value was displayed when I used a Text field with a space in front of the 0... but I can't use that option. When I used an Integer field with the value of 0, the field still displays a null value.

Zero4ffect’s picture

Have you tried disallowing 'Null' values for that field? It can be easily set with phpMyAdmin.
1. Select the table in question, click the 'Structure' tab.
2. Click the 'pencil icon' for the field you want to edit.
3. Uncheck the 'Null' checkbox.
4. Click the 'Save' button.

Hope that helps. =)

mixxmac’s picture

Thanks for the suggestion. The problem I was having fixed itself in another installation. It may have been a bug or something specific to the modules I was using at the time.