I have a Rules Component that I want to run every week, using cron. The component's elements: - set a variable (emailbodytext) - viewsloop 1 to fill the emailbodytext with titles of all recent nodes - viewsloop 2 to send emails to selected users When I (as admin) execute the component, it works fine: all selected users receive a mail with the recent node-titles. When I execute thru cron (after planning it) viewsloop 1 always gives zero results, which results in sending empty mails to all selected users in viewsloop 2. **Question:** Why does one view seem to give results and the other does not? Both views have the same access setting (role: adm) in the "Rules setting"-part. I add the view from viewsloop 1 here: $view = new view(); $view->name = 'nieuwigheden'; $view->description = 'nieuwe items van de laatste x dagen: blokken om in overzicht op te nemen'; $view->tag = 'default'; $view->base_table = 'node'; $view->human_name = 'Nieuwigheden'; $view->core = 7; $view->api_version = '3.0'; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ /* Display: Master */ $handler = $view->new_display('default', 'Master', 'default'); $handler->display->display_options['title'] = 'Nieuwigheden'; $handler->display->display_options['use_more_always'] = FALSE; $handler->display->display_options['use_more_text'] = 'meer'; $handler->display->display_options['access']['type'] = 'role'; $handler->display->display_options['access']['role'] = array( 2 => '2', ); $handler->display->display_options['cache']['type'] = 'none'; $handler->display->display_options['query']['type'] = 'views_query'; $handler->display->display_options['exposed_form']['type'] = 'basic'; $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Toepassen'; $handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Opnieuw instellen'; $handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Sorteer op'; $handler->display->display_options['exposed_form']['options']['sort_asc_label'] = 'Oplopend'; $handler->display->display_options['exposed_form']['options']['sort_desc_label'] = 'Aflopend'; $handler->display->display_options['pager']['type'] = 'full'; $handler->display->display_options['pager']['options']['items_per_page'] = '10'; $handler->display->display_options['pager']['options']['expose']['items_per_page_label'] = 'Items per pagina'; $handler->display->display_options['pager']['options']['expose']['items_per_page_options_all_label'] = '- Alle -'; $handler->display->display_options['pager']['options']['tags']['first'] = '« eerste'; $handler->display->display_options['pager']['options']['tags']['previous'] = '‹ vorige'; $handler->display->display_options['pager']['options']['tags']['next'] = 'volgende ›'; $handler->display->display_options['pager']['options']['tags']['last'] = 'laatste »'; $handler->display->display_options['style_plugin'] = 'table'; /* Relatie: Inhoud: Auteur */ $handler->display->display_options['relationships']['uid']['id'] = 'uid'; $handler->display->display_options['relationships']['uid']['table'] = 'node'; $handler->display->display_options['relationships']['uid']['field'] = 'uid'; $handler->display->display_options['relationships']['uid']['required'] = TRUE; /* Veld: Gebruiker: Naam */ $handler->display->display_options['fields']['name']['id'] = 'name'; $handler->display->display_options['fields']['name']['table'] = 'users'; $handler->display->display_options['fields']['name']['field'] = 'name'; $handler->display->display_options['fields']['name']['relationship'] = 'uid'; /* Veld: Inhoud: Titel */ $handler->display->display_options['fields']['title']['id'] = 'title'; $handler->display->display_options['fields']['title']['table'] = 'node'; $handler->display->display_options['fields']['title']['field'] = 'title'; $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE; $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE; /* Veld: Inhoud: Body */ $handler->display->display_options['fields']['body']['id'] = 'body'; $handler->display->display_options['fields']['body']['table'] = 'field_data_body'; $handler->display->display_options['fields']['body']['field'] = 'body'; $handler->display->display_options['fields']['body']['label'] = 'Berichttekst'; /* Veld: Inhoud: Datum van inzending */ $handler->display->display_options['fields']['created']['id'] = 'created'; $handler->display->display_options['fields']['created']['table'] = 'node'; $handler->display->display_options['fields']['created']['field'] = 'created'; $handler->display->display_options['fields']['created']['label'] = 'Datum'; $handler->display->display_options['fields']['created']['date_format'] = 'datum_zndr_tijd'; $handler->display->display_options['fields']['created']['second_date_format'] = 'long'; /* Veld: Gebruiker: E-mailadres */ $handler->display->display_options['fields']['mail']['id'] = 'mail'; $handler->display->display_options['fields']['mail']['table'] = 'users'; $handler->display->display_options['fields']['mail']['field'] = 'mail'; $handler->display->display_options['fields']['mail']['relationship'] = 'uid'; /* Sorteercriterium: Inhoud: Datum van inzending */ $handler->display->display_options['sorts']['created']['id'] = 'created'; $handler->display->display_options['sorts']['created']['table'] = 'node'; $handler->display->display_options['sorts']['created']['field'] = 'created'; $handler->display->display_options['sorts']['created']['order'] = 'DESC'; /* Filtercriterium: Inhoud: Gepubliceerd */ $handler->display->display_options['filters']['status']['id'] = 'status'; $handler->display->display_options['filters']['status']['table'] = 'node'; $handler->display->display_options['filters']['status']['field'] = 'status'; $handler->display->display_options['filters']['status']['value'] = 1; $handler->display->display_options['filters']['status']['group'] = 1; $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE; /* Filtercriterium: Inhoud: Datum van inzending */ $handler->display->display_options['filters']['created']['id'] = 'created'; $handler->display->display_options['filters']['created']['table'] = 'node'; $handler->display->display_options['filters']['created']['field'] = 'created'; $handler->display->display_options['filters']['created']['operator'] = '>='; $handler->display->display_options['filters']['created']['value']['value'] = '2017-09-01'; $handler->display->display_options['filters']['created']['group'] = 1; /* Display: Rules VAB last 7 days */ $handler = $view->new_display('views_rules', 'Rules VAB last 7 days', 'views_rules_1'); $handler->display->display_options['defaults']['access'] = FALSE; $handler->display->display_options['access']['type'] = 'role'; $handler->display->display_options['access']['role'] = array( 1 => '1', ); $handler->display->display_options['pager']['type'] = 'some'; $handler->display->display_options['pager']['options']['items_per_page'] = '50'; $handler->display->display_options['pager']['options']['offset'] = '0'; $handler->display->display_options['defaults']['fields'] = FALSE; /* Veld: Inhoud: Nid */ $handler->display->display_options['fields']['nid']['id'] = 'nid'; $handler->display->display_options['fields']['nid']['table'] = 'node'; $handler->display->display_options['fields']['nid']['field'] = 'nid'; /* Veld: Inhoud: V/A/B */ $handler->display->display_options['fields']['field_v_a_b']['id'] = 'field_v_a_b'; $handler->display->display_options['fields']['field_v_a_b']['table'] = 'field_data_field_v_a_b'; $handler->display->display_options['fields']['field_v_a_b']['field'] = 'field_v_a_b'; $handler->display->display_options['fields']['field_v_a_b']['type'] = 'taxonomy_term_reference_plain'; /* Veld: Inhoud: Titel */ $handler->display->display_options['fields']['title']['id'] = 'title'; $handler->display->display_options['fields']['title']['table'] = 'node'; $handler->display->display_options['fields']['title']['field'] = 'title'; $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE; $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE; /* Veld: Inhoud: Body */ $handler->display->display_options['fields']['body']['id'] = 'body'; $handler->display->display_options['fields']['body']['table'] = 'field_data_body'; $handler->display->display_options['fields']['body']['field'] = 'body'; $handler->display->display_options['fields']['body']['label'] = 'Berichttekst'; /* Veld: Inhoud: Datum van inzending */ $handler->display->display_options['fields']['created']['id'] = 'created'; $handler->display->display_options['fields']['created']['table'] = 'node'; $handler->display->display_options['fields']['created']['field'] = 'created'; $handler->display->display_options['fields']['created']['label'] = 'Datum'; $handler->display->display_options['fields']['created']['date_format'] = 'datum_zndr_tijd'; $handler->display->display_options['fields']['created']['second_date_format'] = 'long'; /* Veld: Gebruiker: Naam */ $handler->display->display_options['fields']['name']['id'] = 'name'; $handler->display->display_options['fields']['name']['table'] = 'users'; $handler->display->display_options['fields']['name']['field'] = 'name'; $handler->display->display_options['fields']['name']['relationship'] = 'uid'; /* Veld: Gebruiker: E-mailadres */ $handler->display->display_options['fields']['mail']['id'] = 'mail'; $handler->display->display_options['fields']['mail']['table'] = 'users'; $handler->display->display_options['fields']['mail']['field'] = 'mail'; $handler->display->display_options['fields']['mail']['relationship'] = 'uid'; /* Veld: Gebruiker: Gemeente */ $handler->display->display_options['fields']['field_p_gemeente']['id'] = 'field_p_gemeente'; $handler->display->display_options['fields']['field_p_gemeente']['table'] = 'field_data_field_p_gemeente'; $handler->display->display_options['fields']['field_p_gemeente']['field'] = 'field_p_gemeente'; $handler->display->display_options['fields']['field_p_gemeente']['relationship'] = 'uid'; $handler->display->display_options['fields']['field_p_gemeente']['type'] = 'text_plain'; $handler->display->display_options['defaults']['filter_groups'] = FALSE; $handler->display->display_options['defaults']['filters'] = FALSE; /* Filtercriterium: Inhoud: Gepubliceerd */ $handler->display->display_options['filters']['status']['id'] = 'status'; $handler->display->display_options['filters']['status']['table'] = 'node'; $handler->display->display_options['filters']['status']['field'] = 'status'; $handler->display->display_options['filters']['status']['value'] = 1; $handler->display->display_options['filters']['status']['group'] = 1; $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE; /* Filtercriterium: Inhoud: Datum van inzending */ $handler->display->display_options['filters']['created']['id'] = 'created'; $handler->display->display_options['filters']['created']['table'] = 'node'; $handler->display->display_options['filters']['created']['field'] = 'created'; $handler->display->display_options['filters']['created']['operator'] = '>='; $handler->display->display_options['filters']['created']['value']['value'] = '-8 days'; $handler->display->display_options['filters']['created']['value']['type'] = 'offset'; $handler->display->display_options['filters']['created']['group'] = 1; /* Filtercriterium: Inhoud: Type */ $handler->display->display_options['filters']['type']['id'] = 'type'; $handler->display->display_options['filters']['type']['table'] = 'node'; $handler->display->display_options['filters']['type']['field'] = 'type'; $handler->display->display_options['filters']['type']['value'] = array( 'vraag_of_aanbod' => 'vraag_of_aanbod', ); $handler->display->display_options['rules_variables'] = array( 'nid' => array( 'enabled' => 1, 'rendered' => 0, 'type' => 'integer', 'label' => 'Nid', 'name' => 'nid', ), 'field_v_a_b' => array( 'enabled' => 1, 'rendered' => 1, 'type' => 'text', 'label' => 'V/A/B', 'name' => 'field_v_a_b', ), 'title' => array( 'enabled' => 1, 'rendered' => 0, 'type' => 'text', 'label' => 'Titel', 'name' => 'title', ), 'body' => array( 'enabled' => 1, 'rendered' => 1, 'type' => 'text', 'label' => 'Berichttekst', 'name' => 'body', ), 'created' => array( 'enabled' => 1, 'rendered' => 0, 'type' => 'date', 'label' => 'Datum', 'name' => 'created', ), 'name' => array( 'enabled' => 1, 'rendered' => 0, 'type' => 'text', 'label' => '(auteur) Naam', 'name' => 'name', ), 'mail' => array( 'enabled' => 1, 'rendered' => 0, 'type' => 'text', 'label' => '(auteur) E-mailadres', 'name' => 'mail', ), 'field_p_gemeente' => array( 'enabled' => 1, 'rendered' => 1, 'type' => 'text', 'label' => '(auteur) Gemeente', 'name' => 'field_p_gemeente', ), ); $translatables['nieuwigheden'] = array( t('Master'), t('Nieuwigheden'), t('meer'), t('Toepassen'), t('Opnieuw instellen'), t('Sorteer op'), t('Oplopend'), t('Aflopend'), t('Items per pagina'), t('- Alle -'), t('Offset'), t('« eerste'), t('‹ vorige'), t('volgende ›'), t('laatste »'), t('auteur'), t('Naam'), t('Titel'), t('Berichttekst'), t('Datum'), t('E-mailadres'), t('Rules VAB last 7 days'), t('Nid'), t('V/A/B'), t('Gemeente'), );