Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
content.views_.inc_.patch | 829 bytes | KarenS |
Comments
Comment #1
yched CreditAttribution: yched commentedMakes sense.
Are both tests necessary ? $db_info['columns'] is always at least an empty array, so
if($db_info['columns'])
should be enough ?Comment #2
KarenS CreditAttribution: KarenS commentedIs 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().
Comment #3
KarenS CreditAttribution: KarenS commentedNo, 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().
Comment #4
yched CreditAttribution: yched commentedI think we use if(empty()) { more often for this, so I changed to this :-)
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.