I'm attempting to embed a view but need to disable the cache in this instance while leaving it enabled in other instances. I'm attmepting to do this using code but nothing I've tried seems to work. Here is my code so far:
// Get the view and attach the handlers with the build call $view_object = views_get_view($view_name); $view_object->set_arguments($view_args); $view_object->build($view_display); // Manually editing the cache here does nothing //$view_object->display_handler->options['cache']['type'] = 'none'; // Override option breaks the view object and the get plugin does nothing. $view_object->display_handler->override_option('cache', 'none'); // Prints tell me that the previous two lines have not actualy changed the cache method. dsm($view_object->display_handler, 'display handler'); dsm($view_object->display_handler->get_plugin('cache'), 'get plugin cache'); // Returns the cached copy of the view despite changing the option. $view_object->execute($view_display);
Any views experts out there know how to override this cache option?