In the views hook domain_views_views_data
tables are defined for Views. One table is domain_access
. It defines a join between node
and domain_access
. One extra field is used in the ON:
array('field' => 'realm', 'value' => 'domain_id', 'numeric' => FALSE),
The result of the left join (from the Views query preview):
LEFT JOIN {domain_access} domain_access ON node.nid = domain_access.nid AND domain_access.realm = 'domain_id'
but there's no reference to the current domain. If I add:
array('field' => 'gid', 'value' => '***CURRENT_DOMAIN***', 'numeric' => TRUE),
as 2nd extra
, the JOIN works:
LEFT JOIN {domain_access} domain_access ON node.nid = domain_access.nid AND (domain_access.realm = 'domain_id' AND domain_access.gid = '1')
Is that how it's meant to work?
I came across this bug when I added "Domain Access: Available on current domain" as field. The result was always "Yes", because there was no domain_id
reference in the JOIN, so a result for that nid
was always found (because there's always at least 1 domain for every nid
).
Related: http://drupal.org/node/1373016
Comments
Comment #1
agentrickardPlease provide steps to replicate the bug -- expected behavior, configuration of the view, observed behavior -- or simply collapse the two issues into one.
Comment #2
rudiedirkx CreditAttribution: rudiedirkx commentedIs not a bug. My bad. Closed.
Comment #2.0
rudiedirkx CreditAttribution: rudiedirkx commentedrelated link