I have caching turn on for the view, after creating the node from the "Add new ..." link and redirect back to the original parent node, the embedded view is the old cache one. Would it be possible to clear that view cache in this case?

Comments

Crell’s picture

Um. What "add new" link?

View caching is by design separate from normal Drupal caching. I don't think views_attach should override that behavior, especially since there's no way for it to know when it "should" clear the cache.

mattyoung’s picture

StatusFileSize
new48.69 KB

Maybe I got confused with nodereference_url? See the attached image. There is a "Create new class session" link right below the attached view. I thought this link is put there by view_attach? When I click that, it goes to the node/add/class_session page with the node reference field already set to the node it came from. When I finish creating the class session and back to viewing the "class" node where it came from, the attached view is not updated because the view is cached. I'm sorry if I got thing mix up but I thought this link is from view_attach. If so then you know that view's cache should be flush to get the new node show up.

Crell’s picture

Category: feature » support
Status: Active » Fixed

No, the link is from nodereference_url. The view is from views_attach. There's no way for views_attach to know that its data has been updated. If you need that to be updated immediately, don't cache it.

Or, I suppose you could throw in a very small custom module to clear the views data cache every time someone submits a node. That's not something I would include in views_attach, though.

Status: Fixed » Closed (fixed)

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