Hide links to empty views

Created on 23 June 2009, about 15 years ago
Updated 16 May 2024, about 1 month ago

I'm trying to get the results of a view using PHP, but the result of views_get_view always seems to be empty, even though there are nodes in that view...

The code I'm using is as follows:

<?php
  $my_view = views_get_view('Activities_Accommodation');
  $my_view->set_display('page_1');
  $my_view->pre_execute($fields['title']->raw);
  $my_view->execute();
  dsm($my_view->result);
?>

When I go to the view in question with the argument in the URL, I see two nodes; however the output of dsm() is an empty array. What am I doing wrong?

πŸ’¬ Support request
Status

Fixed

Version

2.6

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024