Closed (fixed)
Project:
Insert View
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
10 Apr 2007 at 22:19 UTC
Updated:
14 Jul 2007 at 14:46 UTC
I've been upgrading a site to Drupal 5, and noticed a change in the insert_view behavior with exposed filters:
let's say I have a view named "customers", that displays a list of customers with an exposed filter (taxonomy term "industry"). That way the user can sort customers by industry.
Then I embed this view in a page "node/150", using insert_view
in Drupal 4.7, when I use the exposed filter, it redirects to something like this:
"node%2F150&filter0%5B%5D=20"
However, in Drupal 5.1, it redirects to this:
"views%2Fcustomers&filter0%5B%5D=20"
So, you see, it redirects to the view page, not to the node where I have embedded the view. It is a bit of a problem.
Comments
Comment #1
Hubert_r commentedAny idea on this one?
Comment #2
mlsamuelson commentedh_razack,
What versions of Views are you using?
I'll see if I can't look into this more over the next few days.
mlsamuelson
Comment #3
merlinofchaos commentedAssuming you're embedding your view via views_build_view, prior to actually calling that function try $view->url = 'node/150' (or whatever the node you're currently looking at is).
If you're using insert_view, that probably won't work.
What you've probably run into is a good result from an unintended behavior that was later fixed.
Comment #4
mlsamuelson commentedAs insert_view is using views_build_view to embed the view, adding
before views_build_view does the trick.
I want to test this a bit more and give others a chance to add their thoughts on the subject, but if it doesn't seem to cause any problems, I'll probably add the functionality to the 5.x branch.
mlsamuelson
Comment #5
mlsamuelson commentedI've committed to the 5 branch and to HEAD a fix for this issue. Nodes containing inserted views with exposed filters now submit back to the original node with the inserted view feeling the update.
Instead of using arg, I ended up using:
Thanks for putting me on the trail for this fix, merlinofchaos.
mlsamuelson
Comment #6
(not verified) commented