I ran into this bug when trying to get computed_field working in D6. We don't require fields to provide columns to store data in the database, but if they do not, we should not be trying to create Views tables for those fields. There was a test to skip creating views tables for fields with no columns in the D5 version but it is missing in the D6 version. Unpatched, the code creates all kinds of ugly errors for fields that do not declare columns.

I committing the attached patch to fix this.

CommentFileSizeAuthor
content.views_.inc_.patch829 bytesKarenS
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Makes sense.

+ if (empty($db_info['columns']) || !count($db_info['columns'])) {

Are both tests necessary ? $db_info['columns'] is always at least an empty array, so if($db_info['columns']) should be enough ?

KarenS’s picture

Is it? If a module returns nothing it could be NULL. At any rate I was getting undefined index errors if I didn't test for empty().

KarenS’s picture

No, you were right, by that time it is guaranteed to be an array. I was getting the undefined indexes before I added that fix. I simplified it to just use count().

yched’s picture

I think we use if(empty()) { more often for this, so I changed to this :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.