2

I have a view based on a content type. I added a new boolean field Premium to the content type that I wanted to add to the view as filter criteria. However when I added it I got no results in my view, no matter whether I set its filter value to '1' or '0'.

After doing some investigation, I queried the tables and found that field_data_field_premium had no values, while field_revision_field_premium was storing values. I tested checking and unchecking the Premium checkbox on various nodes. The state of the checkbox was preserved on the node, and I confirmed that data was being stored in the revision table, and still there were no rows in the data table. After checking and unchecking the box and saving several times on a single node, the data only stays in the revision table and rows are never inserted in the data table.

This causes my view not to work, because the query that views creates does a join on the data table, not the revision table. Since there are no rows in the data table, the query returns no rows overall since there is nothing to join to.

Thinking that the field was somehow broken, I deleted it and re-created it, but I am still getting the same behavior of data only being stored in the revision table. For further testing, I created another stock Drupal site, with a content type that has a boolean field. My test site is storing data in both the data and revision table.

What is going on? Is the field screwed up somehow on this site? The content type I'm adding this field to is in a feature -- could that be the source of the problem?

Edit I just exported and reverted the feature with my field added, and I still get the same behavior of values, either 1 or 0, only being stored in the field's revision table.

0

Okay, I figured it out. We have the workbench module installed on this site for multi-stage moderation, and the node I was editing was not the published version of the draft :þ

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.