I am quite stuck with this, so I hope you can help me out…
I have a view which filters (contextual filter) by 'nid'. I have two 'filter criteria's (view ui):
- Node type
I want to embed that view in a page programmatically through an Ajax call. I have discovered it sometimes returns the correct node and sometimes not. It depends on the specific node so for example it always retrieves the node nid = '4' and it never does for nid = '35'
Trying to figure out where the problem comes from I have tried few things. For example: I have tried to embed the view using panels, just for testing, using arguments for the contextual filter. It always work (always retrieve the correct node) this way. But when I call the view programmatically from a form building function (the one I use inside 'drupal_get_form()'), it just work with some nodes (some values of nid).
I am using devel for debugging and, when the view doesn't returns results,
$view->build_info['fail'] = TRUE
Here is the way I call the view:
$view = views_get_view('proyecto_en_arquitecto'); $view->init(); $view->set_display('block_1'); $view->set_arguments('35'); $view->execute(); dpm($view); //Here is where I can see the building process fails
I am lost as I don't have a clue of why it just works with some nodes…
I hope you can point me to the right direction.
Thanks in advance for your help and let me know if you need further information.