Trying to make one tracker for current domain and another tracker for all domains.

In "special request page" i putted all needed lines such as "tracker/*", But also tested without them - same result. Except when i switched on Domain Advanced, even "special request page" couldn't help to see nodes from not current domains. Only nodes assigned to current domain or affiliated to all were available. But this looks more like a Domain Advanced issue or maybe not. So switching off Domain Advanced and return to Domain Views.

1. Made one view with filter "Domain Access: Available on current domain = TRUE"
2. Second view with filter "Domain Access: Available on current domain = exposed"

View№1 show nodes assigned to current domain AND affiliated to all domains.
View№2 shows:
if TRUE , nodes assigned to current domain only
if FALSE , all nodes from all sites except nodes assigned to current domain
if ANY , all nodes from all sites.

Is this little difference in how "TRUE" behaves in exposed filter and hidden filter is a bug or designed so?
The best to have all 4 choices in both exposed and hidden filter. Maybe this should be a feature request?

Comments

agentrickard’s picture

So you are making a Views-based tracker?

Can you attach the View?

Skirr’s picture

StatusFileSize
new9.43 KB
new8.7 KB

Nothing special of course.
view1.txt - this is just a parent view with exposed filter
view2.txt - this one with hidden TRUE

Don't mind the path and menu options, there is just 3 more views , that are tabs on same page.

nonsie’s picture

Status: Active » Needs work

For tracking purposes here's what is wrong with the query (applies in all cases other than "published to current domain", regular filter and exposed)
Available on current domain = TRUE:

WHERE ((domain_access.realm = 'domain_id' AND domain_access.gid = ***CURRENT_DOMAIN***) OR (domain_access.realm = 'domain_site' AND domain_access.gid = 0))

Available on current domain = FALSE:

WHERE ((domain_access.realm = 'domain_id' AND domain_access.gid <> ***CURRENT_DOMAIN***) OR (domain_access.realm = 'domain_site' AND domain_access.gid = 0))

The easiest fix is to alter domain_views_handler_filter_domain_access_current_all.inc
and use the following:

if (empty($this->value)) {
  $this->query->add_where($this->options['group'], "(($table.realm = 'domain_id' AND $table.$this->real_field ". '<>' ." ***CURRENT_DOMAIN***))");
}
else {
  $this->query->add_where($this->options['group'], "(($table.realm = 'domain_id' AND $table.$this->real_field ". '=' ." ***CURRENT_DOMAIN***) OR ($table.realm = 'domain_site' AND $table.$this->real_field = 0))");
}

This solution however is quite clunky. Ken, any ideas/suggestions?

agentrickard’s picture

This looks proper to me. We need to run different WHERE clauses in the two conditions, so the IF...ELSE is fine.

nonsie’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

Patch attached.

agentrickard’s picture

Status: Needs review » Fixed
StatusFileSize
new1.58 KB

Patch from root. Committed to HEAD.

Status: Fixed » Closed (fixed)

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