foreach ($groups as $group) {
you expose a new view, but there is no code at all to filter by group that view, so it basically doesn't work at all.

I added this to the view filters:

    $terms = taxonomy_get_term_by_name($group);
    $term = $terms[0];
    $view->filter = array(
      array (
        'tablename' => 'term_node_1',
        'field' => 'tid',
        'operator' => 'AND',
        'options' => '',
        'value' => array (
          0 => $term->tid,
        ),
      ),
    );

and now it works, but I don't know if "term_node_1" is the correct string in every deployment.

CommentFileSizeAuthor
#1 ads_active_by_group_view.patch1.63 KBmalaussene

Comments

malaussene’s picture

Component: ad.module » ad module
Status: Active » Needs review
StatusFileSize
new1.63 KB

From the title of the view, it seems that 'Ad: Status' must be set to 'active'.
Here is patch that add the 2 filters to the 'active_@group_group_ads' views:

  1. 'Ad: Status' set to active as the title of the view seems to imply
  2. 'Taxonomy: Terms for Ad groups' setup by using _ad_get_vid() and taxonomy_get_term_by_name()
jeremy’s picture

Version: 5.x-1.3-2 » 5.x-1.x-dev
Status: Needs review » Fixed

Excellent, thanks!

Patch applied in the development tree. Testing would be greatly appreciated.

malaussene’s picture

thank you, and keep the hard work :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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