hiya,

We are using the buildkit method with features for our deployment model.

In {site}/profiles/{project}/modules/features/{feature}/{feature}.features.inc, we specify the location of the custom template I want to use for a view within the feature as follows (whereas the feature is named 'rwce_events':

/**
 * Implementation of hook_views_api().
 */
function rwce_events_views_api() {
  return array(
    'api' => '3.0-alpha1',
    'path' => drupal_get_path('module', 'rwce_events') . '/views',
    'template path' => drupal_get_path('module', 'rwce_events') . '/views/templates',
  );
}

(I believe that's the way it's supposed to be done. If anyone has any advice otherwise, plz shoot.)

BUT, _views_find_module_templates in views.module doesn't find the path correctly in such cases.

I've attached a patch that addresses this. It could definitely use some review (I don't understand the inner workings of the views cache -- but the patch works).

We're on views alpha1, but from looking at the code, this is still an issue in dev3, so hoping a maintainer sees this.

Peace out to the views team,

Shiraz
(Affinity Bridge, Vancouver)

Comments

shiraz dindar’s picture

Issue tags: +views templates features buildkit
StatusFileSize
new952 bytes

Sorry, that first patch was in error. Here's the working version:

dawehner’s picture

Status: Active » Needs work

Can you please try to use drupal codestyle?


+          if (substr($path,0,8)=="profiles") {
+            $templatepath=$path;
+          }
+          else {
+            $templatepath=dirname($files[$match]->filename);
+          } 

Additional it would be probably helpfull to explain it in a comment.

PS: you should really not use alpha1 anymore, it's really really old

shiraz dindar’s picture

Status: Needs work » Active
StatusFileSize
new946 bytes

Third time's a charm? (blush)

dawehner’s picture

An explantation is the main point here

http://drupal.org/coding-standards if you need help with the codestyles of drupal.

dawehner’s picture

An explantation is the main point here

http://drupal.org/coding-standards if you need help with the codestyles of drupal.

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)