Following code is not loaded when it is under hook_menu() function:

    if (module_exists('views')) {
      include_once('./'. drupal_get_path('module', 'nat') .'/includes/nat_views.inc');
    }

Result is that Views support is not working.

CommentFileSizeAuthor
#1 nat_include_views.patch865 bytesanantagati

Comments

anantagati’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new865 bytes

Code for including file moved outside of hook_menu function.

anantagati’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Zen’s picture

Status: Fixed » Needs work

IIRC, while I tested that the file was being included, it might not have been included early enough for views. Could you please stick that block of code in a hook_init instead and see what happens? Please avoid sticking any code besides global defines in the global namespace.

Thanks Petr,
-K

anantagati’s picture

Status: Needs work » Fixed

I moved code to hook_init. It works now good. Thanks.

Commited.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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