I used a text-field in the filter-declaration of a view. As soon as this text-field is attached to another contenttype, the view does not work any more (error and no output). If you save the view definition again (without making any modifications), everything is correct.
Error message:
user warning: Unknown column 'node_data_field_FIELDNAME.field_FIELDNAME_value' in 'where clause' query ....
FIELDNAME = the name of the text-field
Comments
Comment #1
merlinofchaos commentedSounds like CCK is changing the name of the field on us. That could be a problem.
If this isn't fixable, CCK fields may need to mark themselves not cacheable.
Comment #2
karens commentedThe fieldname isn't changing so I don't know what is going on here. Will have to investigate...
Comment #3
karens commentedOK, I know what the problem is. The reason this happened is that when you change a field from a stand-alone to a shared field or vice versa, its table changes, which means the views code must be updated to reflect the new table. Maybe this will be fixed by yched's proposal for cleaning up views fields when CCK fields are altered or deleted, but we should be sure that fixes this use case.
Comment #4
karens commentedChanging the description a bit so it doesn't get missed.
Comment #5
merlinofchaos commentedArgh. Ok, then this is another case of Views' Inappropriately Caching Queries. This really needs to be fixed so that the cache is more fluid. It's turning into a pain in the butt.
Comment #6
yched commentedmoving to the more recent but more general http://drupal.org/node/117362
Comment #7
yched commentedBTW, Earl : I don't think there is a problem with Views inappropriately caching queries : CCK currently makes the choice not to use 'cacheable' = 'no' for its fields, so Views is behaving correctly on that account.
Comment #8
merlinofchaos commentedThe problem is that there is no mechanism to flush a views' cached query. If it were stored in the regular cache it could flush that cache more readily.
Comment #9
yched commentedRight. That is true.
Is this something you plan to have in a next release (which means we could ditch the cck issue for now), or is this Views 2 stuff ?
Comment #10
merlinofchaos commentedI haven't figured out where that fix is going to end up yet. It may be Views 2...but it doesn't have to be. It's an effort thing.
Comment #11
yched commentedsetting back as active and http://drupal.org/node/117362 as duplicate after all :-)
Comment #12
yched commentedOK - does this mean you're expecting patches for this ?
Comment #13
merlinofchaos commentedI would accept patches but I am not expecting patches for it.
Comment #14
yched commentedLet's get to it then :-)
BTW, this won't solve the issue on CCK field deletion, which occurs even if no query is cached. This would require removing the corresponding field / filter / arg / sort from the view instead of just regenerating the query.
I wonder if that's cool BTW, altering a view in the user's back ? Might be troublesome for args, have unexpected consequences on paths patterns...
Comment #15
merlinofchaos commentedIt should be okay if you do it right.
Comment #16
yched commentedviews patch submitted at http://drupal.org/node/118069
Comment #17
yched commentedshould be fixed with latest CCK 1.5 and Views 1.6 (even if Views 1.6 is still beta)
Comment #18
(not verified) commented