I use the simpleads module together with domain, and sometimes the 'ad' block is empty, because the queries in the simpleads_simpleads_order() function does not add 'node_access' tag to $query object.
But the _simpleads_load_ads() function check this: if ($node->simpleads_show == 1) {
$node->simpleads_show is filled with correct value, therefore $result will be empty, if the query select a node which is belong to another domain.

Block settings: Order= Random, Limit=1
5 domain.

CommentFileSizeAuthor
#1 simpleads-1494410.patch1.7 KBsweetchuck

Comments

sweetchuck’s picture

Status: Active » Needs review
StatusFileSize
new1.7 KB

I think this line solve the problem.
function simpleads_simpleads_order(…)
$query->addTag('node_access');

minnur’s picture

Thanks for the patch, i will review this soon

sweetchuck’s picture

May be necessary to open an new issue.
I just now see the $query->orderRandom(); is appear in every order method section.
Is this a feature or a classic CopyPaste bug?

if ($delta == 'order_created_desc' || $delta == 1) {
  // …
  $query->orderRandom();
  $query->orderBy('n.created', 'DESC');
  // …
}
minnur’s picture

Thanks for finding this. This is definitely not a feature :)

minnur’s picture

Status: Needs review » Fixed

fixed in dev.

Status: Fixed » Closed (fixed)

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