hello,
I've create a module to store my views in code (http://www.mc-kenna.com/drupal/2009/05/managing-drupal-views-the-proper-way).
When my view is in database, it's in the Ressource list, when my view is in code, it does not appear in the list.

Comments

ben.kyriakou’s picture

I can confirm this issue. It's occurring because the views are being retrieved directly from the database rather than via the views API. I've fixed this with some ugly (but functional) code replacement. In services_views.module, replace line 93;

<?php
$results = db_query('SELECT vv.name, vd.id FROM {views_display} AS vd LEFT JOIN {views_view} AS vv ON vd.vid = vv.vid WHERE vd.display_plugin = :display_name', array(':display_name' => 'services'))->fetchAll();
?>

With;

<?php
$results = array();
$views = views_get_enabled_views();

foreach ($views as $view) {
  foreach ($view->display as $display) {
    if ($display->display_plugin === 'services') {
      $results[] = (object) array(
        'name' => $view->name,
        'id' => $display->id,
      );
    }
  }
}
?>

I'm not particularly familiar with the views API so there's probably a better method of doing this, but it's working well enough for my purposes.

Edit: Having a poke around, I see this is also fixed (in a much nicer way) in dev

ygerasimov’s picture

Status: Active » Fixed

Closing this issue as it has been fixed already.

Status: Fixed » Closed (fixed)

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