Just upgraded to DA 6.x-2.0-rc7 and am seeing the following User Warning:
user warning: Unknown column 'nid' in 'field list' query: SELECT domain.domain_id AS domain_id, domain.subdomain AS domain_subdomain, domain.sitename AS domain_sitename, nid FROM domain domain WHERE domain.valid <> 0 ORDER BY domain_sitename ASC in /home/brat/public_html/sites/all/modules/views/includes/view.inc on line 735.
I have a view that lists (or used to list) my domains and link to each one, however that's no longer appearing so I'm thinking that's the problem... I have subdomain and sitename fields in that view, but didn't have a domain_id field, so I added a domain_id field but that didn't seem to do anything...
I also have an overridden views temple file for this view, but I don't think it's even getting to that stage as I've added dsm($row) which isn't displaying anything.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | domain_exported_view.txt | 2.74 KB | Anonymous (not verified) |
| #2 | 485762-views.patch | 1.82 KB | agentrickard |
Comments
Comment #1
agentrickardThis is a View from the base 'domain' table? Why is it trying to select a node id?
Comment #2
agentrickardThis is a temporary patch. I suspect we are trying to use the same field handler for different reasons. We cannot load NID on straight domain views.
nonsie?
Comment #3
agentrickardComment #4
nonsieYour patch is correct - it should not include nid as an additional field (nid is only available for view type node).
Comment #5
agentrickard@nonsie
You ready to commit this, then?
Comment #6
agentrickardActually, I'm not sure.
It looks to me like that code is in there for use when gathering data from the {domain_access} table. So I think this needs work. AFAIK, we should be do this when dealing with node data, but not if the base table is {domain}.
Yes?
Comment #7
nonsieI ran a simple test after applying the patch and created two views - one using view type domains and one view type node. These are the only view types that allow domain fields (view type user uses domain_editor table). Both views pull out 3 fields - domain id, sitename and subdomain
Here's the query created by view type = node
view type = domain creates the following query:
I'm pretty sure removing nid does no harm - but it has been a long day and I might remember something overnight that will break if we remove it...
Comment #8
Anonymous (not verified) commentedPatch from #2 worked for me, thanks!
Comment #9
Anonymous (not verified) commentedActually, it seems I now have a related problem...
I'm now getting warnings whenever I clear my cache:
I think the culprit code is what I'm using for my domain view in the overriden views template file:
From the documentation in domain_conf.module, the first argument is the domain ID, not an array, so I don't see what the problem is...
I don't know exactly what the above patch does, but since I only started experiencing this issue since applying the patch, I'm thinking it's related.
Comment #10
nonsieDoes the error go away when you comment out this code in views template file? If so, what's in $row->domain_id once you print it out?
Comment #11
Anonymous (not verified) commentedYes, removing the code removes the errors.
Adding
dsm($row->domain_id);to the end of the file prints out each of my domain IDs (i.e. 0, 5, 2, 7, 4, 6, 1).Comment #12
agentrickardThis is what I mean by the handler being used for more than one use-case. I think that some of the Views that get built want to use the extra fields and some do not.
Comment #13
nonsie@BWPanda can you attach an export of your view? I'm curious what is going on in there...
Comment #14
Anonymous (not verified) commentedExported view attached.
Comment #15
agentrickardMy mistake. BWPanda's issue is unrelated to this bug.
@BWPanda -- your issue is already at #469856: Display site slogan in view?.
Committing #2 to HEAD.