0

I am using Drupal 6 and I am somewhat new to it.

I've been running into a strange behavior.

I have created a new Content Type that have 4 new fields and when I try to make a new Content using this Content Type everything is saved except for the new fields.

Each times that I save the Content the new fields comes out as empty.

I have been looking on search engines without luck, is it a known behavior, is it a bug or is could it be a mismanipulation?

What should I be checking to debug this situation?

The additional fields in question:

Label                     Name                      Type
========================================================
Product Subtitle          field_subtitle            Text
Product Overview          field_overview            Text
Product Features          field_features            Text
Product Specifications    field_n_specifications    Text

These were defined using the UI at: /admin/content/node-type/[content-type-name]/fields

The fields appear correctly when editing/adding new content as well in the listing of the fields in the content type management section.

11
  • how are you creating the content?
    – Jimajamma
    Mar 8 '12 at 19:47
  • @jimajamma Content Management -> Create Content -> (My Content Type)
    – maaudet
    Mar 8 '12 at 19:52
  • check out admin/user/permissions and make sure they are set so you can access those fields
    – Jimajamma
    Mar 8 '12 at 21:02
  • @Jimajamma I have given Admin - Full Admin all the rights that had the name of the content-type in it, I might add that I'm using the admin account to manage the website when it's not about Content or Testings.
    – maaudet
    Mar 8 '12 at 21:08
  • very odd. do some fields get saved and not others?
    – Jimajamma
    Mar 8 '12 at 21:31
1

One final possible oops: goto admin/content/node-type/TYPE/display and make sure the fields are being displayed in that content type.

If all looks well there, then from the comment discussion, this is sounding like your database might have become corrupted, lost some tables, or generally needs to be restored from a backup taken before all of this started to happen. If you go into phpmyadmin (assuming you are using mysql) you can check on the following to confirm:

Basically, CCK uses database tables to define the content types it creates, so, you can look for a table called content_type_MYCONTENTTYPE, eg, MYCONTENTTYPE would equal story, page, album, product, etc.

So, if you find that table, it will have as fields/columns the field values of the fields of the content type: nid, vid, and then any custom fields UNIQUE to it in CCK. By UNIQUE I mean that no other content type uses that field. If, though, let's say you have a field_overview that you use in other content types also, well, that won't be listed here.

Where? Once you start sharing a field between content types, it gets its own table, called content_field_FIELDNAME and in there you will find your content values.

So, in your description above, let's assume the content type is product and that you don't share those fields with any other content type. In your database, there should be a table called content_type_product and in it you should find fields/columns:

vid
nid
field_field_subtitle_value
field_overview_value
field_features_value
field_n_specifications_value

You should also see fields for FIELDNAME_format that tell drupal the text format.

If you DO share any of these fields, let's say you share the field_overview, look for a table called content_field_overview and in it, you'll find columns/fields for value and format.

So, in a nutshell, that's how CCK works with respect to saving fields and so forth. If any of the above isn't there, you have to create it or put it back (and of course, try to figure out how/why it got deleted/corrupted in the first place).

If, though, all of the above is there, and there are values in there for your fields, then something else is going on.

Do the values show up when you edit the node, eg, look at a piece of content with those fields, and if you edit it, do those fields have values, or are they blank? If they have values when you are editing it, then something is causing them to not display.

Did you change or add a text filter that is stripping all your content out?

Did you change your node.tpl.php file and now not printing/displaying these fields for some reason?

Or did you change the display parameters mentioned above at the beginning and they are being hidden or excluded from display?

Anyways, lots to track down but let me know what happened and maybe something else will spring to mind to help track it down to a conclusion.

8
  • I can't find any table named content_type_(My content type), is it normal?
    – maaudet
    Mar 13 '12 at 15:53
  • no, it's my understanding there should be one, I'd look in a database backup and see if one is there...and if so restore it
    – Jimajamma
    Mar 13 '12 at 22:43
  • (if you are in a shared database, there might be a prefix on the table, eg, mysite_content_type_FOO)
    – Jimajamma
    Mar 13 '12 at 22:44
  • There is no prefix, I made sure of this. The weird thing is that there is no tables for the new content, ever. Looks like it never have been added. The weirdest part is that it stopped working also for ancient Content Types which them have their tables.
    – maaudet
    Mar 14 '12 at 0:05
  • I really don't know what could be going on at this point then, so the only thing I can suggest is a backup from when it was working :(
    – Jimajamma
    Mar 14 '12 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.