I am having trouble with exposed views filters.
The url I use to access my app is
http://apps.facebook.com/mikejoconnor/views/roomate_finder
when I press submit, it tries to go to the following url
http://gradspot.interactiveqa.comhttp//apps.facebook.com/mikejoconnor/views/roommate_finder?fb_sig_time=1193776224.7036&fb_sig_added=0&fb_sig_user=587753741&fb_sig_profile_update_time=0&fb_sig_session_key=41c019d5093cd1c3bfbdbe35-587753741&fb_sig_expires=1193846674&fb_sig_api_key=11b812b59e64d8a0192965e6255e0bef&fb_sig=8ded5aec7fb060176f8002515f0227c6&op0=OR&filter0%5B%5D=Atlanta&FB_APP_REQ_PARAM=finder
which obviously doesn't work.
if I copy the views arguments from my site, and append them to my facebook url
http://apps.facebook.com/mikejoconnor/views/roommate_finder?op0=OR&filter0%5B%5D=Austin&FB_APP_REQ_PARAM=
everything works great.
If there is anything I can do to assist with this please let me know. If you would like to point me in the right direction I will be happy to take a try at fixing it.
Thanks
Mike O.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | fb_patch_updated.txt | 829 bytes | nlowhor |
| #8 | fb_patch.diff | 611 bytes | mikejoconnor |
| #6 | fb_views_filter_patch.diff | 528 bytes | mikejoconnor |
Comments
Comment #1
Dave Cohen commentedAre you using the very latest versions of the modules? Are all forms broken, or just exposed views? Do links on a canvas page link to other canvas pages, or back to gradspot.interactiveqa.com?
Comment #2
mikejoconnor commentedOther links work, they all point to the appropriate facebook link. my node/add forms work, It seems to be just with views.
I downloaded the latest dev version this morning.
I'm on google talk with my username @gmail.com if you would like to troubleshoot it that way.
Comment #3
mikejoconnor commentedIs there any other way I can assist with this, or do you need any more info?
Mike O.
Comment #4
Dave Cohen commentedIf you track it down, let me know. I've been too busy to try to reproduce it.
Comment #5
Dave Cohen commentedAlthough in thinking about it... most likely the views module is explicitly setting an action on its form, and doing it in a way that doesn't work on facebook. If that is the case, I'm not sure what the best solution would be. But I will try to reproduce it when I get a chance.
Comment #6
mikejoconnor commentedDave,
I've attached a patch that works for me, but it might be good to test it else where.
Comment #7
Dave Cohen commentedHey, I really appreciate you submitting that patch. I believe that's the first user-contributed patch in the Drupal for Facebook issue queue! Hooray!
However, I'd prefer a patch that solves the problem in general, not just for the views form. If views builds its forms a particular way, odds are other modules do too.
So do you know, what is the $form['#action'] before your code, and what is it set to afterward (that is, the value of $form['#view_name'])?
Comment #8
mikejoconnor commentedAfter I looked into this some more, it seems that this line was causing the issues
return "http://".$_SERVER['HTTP_HOST']. $action;
I've updated my patch. It no longer targets views filters, but instead it removes a leading / from $action, and passes it off the the url() function.
Comment #9
nlowhor commentedI was having the exact same problem with exposed filters in views. I just applied this patch and it works great for me. Thanks a lot for posting it!
Comment #10
nlowhor commentedOk, I'm sorry to say I found an issue with this patch. I was having a lot of issues with form submissions as discussed at http://drupal.org/node/194629. It seems that this patch caused the problem so I had to remove it. Now I'm back to having a problem with my exposed views though. :( Any thoughts?
Comment #11
Dave Cohen commentedThe above patch is going to break other things. Form submissions are weird on facebook canvas pages. If the form goes through facebook (i.e. action is apps.facebook.com/myapp/...), your relying on facebook to forward all the posted information to your server. It forwards most posted values, but not file uploads, and who knows maybe other things are missing. That's why the code you replaced went out of its way to base the URL on $_SERVER['HTTP_HOST'].
From the look of your original URL, it looks like the problem is that the action was already set to be a fully qualified URL. That is, views explicitly set the action to be "http://apps.facebook.com/..."
So I would fix this either by changing views so that it does not set a fully qualified action. Or, fb.module has to look for "http[s]://" at the beginning of an action and if found, leave the action untouched.
Comment #12
nlowhor commentedOk, I think I got this working. I'm not really familiar with the notation used in patch files so I'm just uploading a txt file showing the exact same section of code from fb.module as the above fb_path.diff. I just did basically what Dave suggested and had it check the start of the action for http and use the modified code if it was there and the original code if not. Now my form submissions/redirections work and so do the exposed views.
Comment #13
nlowhor commentedComment #14
nlowhor commentedOk I bumped into a serious problem that seems related to this. When I keep the app in developer mode and other developers install the app, all goes fine. However, if I take it out of developer mode and go to http://apps.facebook.com/myapp, it brings up the screen to continue to install app just fine, then when I click through I get a URL like in the original post where there is a correct url followed by another http:// and more stuff. Of course this brings up a "The requested page was not found." However, the app is installed, and you can click on the link in the left sidebar and bring it up at that point. So there's just a redirection issue. I'll look into this more and report back if I can make it work. Any help is appreciated. Thanks.
Comment #15
nlowhor commentedOk, another update....
I removed the above patch and changed it to the one in post #8 so it only affected my exposed views. The views worked still, but I'm still getting a bad URL when a non-developer adds the app. The URL looks like....
http://apps.facebook.com/mydomainhttp://www.mydomain.com/?auth_token=num...
This is the last item I know about in my app that's crucial and broken.
Thanks. Maybe another idea will come to me and I'll report back.
Comment #16
nlowhor commentedI used the solution given in post #7 of http://forum.developers.facebook.com/viewtopic.php?pid=23230
Apparently this is a common problem.
Comment #17
Letharion commentedSince Drupal 5 is no longer supported, I'm taking the liberty to close all FB D5 issues. Issues that haven't moved since D5 are unlikely to still be valid.