I'm having trouble with my node submission forms and user info form. The submission works and the information is added; however, it always loads a poorly formatted Facebook login page after submission instead of either showing the new node or following the "?destination=" on the URL.
Thoughts anyone? Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | After-form-submit.GIF | 71.47 KB | nlowhor |
Comments
Comment #1
nlowhor commentedDave, I found this discussion you had regarding this same issue - http://lists.drupal.org/archives/development/2007-10/msg00134.html
It certainly seems like you were able to solve the problem since it works on your demo site now. I'm certainly glad to know there's a solution to this. :)
Thanks!
Comment #2
nlowhor commentedStill don't know how to make this work. It seems like it was partially working at some point early during development, but I get nothing now. Any clues?
If I can get this working and solve a different problem with the mini-feed stuff, then I think I'll be good to go. Of course, other problems will probably crop up. :)
Thanks again.
Comment #3
Dave Cohen commentedIf you can tell me how to reproduce the problem, I might be able to help.
Try enabling the devel module and allowing everyone to view devel info. Then have devel show redirection pages. It might be that a redirection after form submit is going to the wrong place? Also try disabling third party modules to see if the problem goes away.
Comment #4
nlowhor commentedDave, thanks for your reply. I have to leave town for a couple of days so I'm not sure when I'll be able to look into the devel module and try to debug this a bit more. I'll get some more info as soon as I can.
In the meantime, I thought I post a screen cap of what I get after submitting the form. It renders the form just fine, the content is created, and then it goes to a page like this instead of showing the new content or following the "?destination" if I happen to be using one. It must just be redirecting to a bad URL. If I'm correct, this is the page one gets in facebook when the URL is bad?
Thanks.
Comment #5
nlowhor commentedOk, I've got some more info. I installed the devel module and gave access permissions to all users. There is apparently a current issue with devel and views so I had to get rid of views to make devel work.
I enabled the redirection page. In my facebook app, after submitting the form I get the following:
The URL http://www.mydomain.com/node/add/product returned HTTP code 200 and no data.
I decided to try the same thing on the drupal site to see if the redirection page is working. This time I get the following:
Facebook API error 102 (see error codes).
Your product has been created.
The user is being redirected to http://www.mydomain.com/product/title - this is correct.
So I guess the answer lies in that facebook error since the submission and redirection seem to be fine.
Comment #6
nlowhor commentedComment #7
Dave Cohen commentedI'd like to help, but I haven't seen this and still don't know why it's happening. From the image you've attached, it looks like facebook's login page is being embedded within the canvas page. As if your canvas callback is returning the contents of that page, or maybe redirecting to it.
First question, is the user logged into drupal when this happens (that is, what page do they see on /user)? Have they added the app or just logged into it?
Can you reproduce this with a core content type, i.e. page or story? If so, can you disable all third-party modules and still reproduce? If not, try enabling the third party modules one at a time and see when the problem arises?
I know that might take a while, but shoot I just haven't seen this with anyone else.
Regarding the error 102, you can't be sure that is also the cause of the canvas page problems. There are some facebook api calls that succeed on canvas pages but fail otherwise. that might have something to do with the infinite session config.
Comment #8
nlowhor commentedThanks for trying to help out. I'll keep at this and provide as much info as I can. Hopefully something will raise a flag.
1) I might be a bit confused on how these settings work for adding the app and being logged in. My settings under Facebook user settings are as follows:
-Require login: allow users who have added this app to their profile
-not logged in user - blank
-logged in user - blank
-Create local acct - if user has added the app
-new user role - 4 (this is a role I created for all contributors to the site who aren't admins)
-make local acct unique - checked
When the user is in facebook and adds content, the content is created and is created with the correct uid as the author. Also, I'm using some custom code that relies on the current uid to pull content for them. This works as well.
That said, when I tried to go to /user inside the facebook app I get "The URL http://www.mydomain.com/user did not respond."
2) I tried to add a core node type, however when I went to /node/add/page I get "The URL http://www.mydomain.com/node/add/page did not respond." Interesting. I did allow permission to add this content type. However, I can go to my custom content types submission forms still. Odd. So the answer is no, I can't reproduce the problem because I can't get that far. :)
3) I'll disable 3rd party modules next if none of this rings a bell and see if I can isolate something that way. It seems to me that there's something going on with authentication, but I'm not really experienced at any of this.
4) I'll worry about the error 102 later as perhaps it's not really an issue at all based on what you're saying.
Thanks again, I hope perhaps you get an idea from some of this.
Comment #9
nlowhor commentedComment #10
Dave Cohen commentedAnother user recently submitted a bug regarding this. Could be related. I'll have to try to reproduce with that setting, but I most likely won't get around to it until next week.
You could try unchecking that. Drupal will probably create a new user for you the next time you visit the app. Oh shoot - you might need to delete your existing account to avoid a name collision. Ugh.
Comment #11
nlowhor commentedI understand if you don't have time to get to this right away. I'll take whatever help I can get. :)
I tried unchecking this setting and it certainly changed things. Now I don't get that login page. Instead I just get that "The URL http://www.mydomain.com/node/add/product did not respond." I still can't load anything for the submissions forms for the core node types or for /user. It still creates the content as well.
I'll try to determine if anything changes when I uninstall 3rd party modules.
Thanks!
Comment #12
Dave Cohen commentedYou could get that error simply because your server or the network is slow. Never assume that is really a bug. Try a few times first, hopefully hosted from a fast machine.
Comment #13
nlowhor commentedRight, I know I've seen that same error before when the server just didn't respond fast enough. Usually a click on the Try Again button would pull it up. However, I just tried a bunch of the other pages that work find, including the submission forms for my custom content types, and they all load almost instantly. I only get that error for /user, after trying to submit a form, or for /node/add/core_node_type.
Comment #14
nlowhor commentedOk, I just deactivated all 3rd party modules except for some of your Facebook modules. I left my core(optional) modules active as well. Same problem, nothing changed.
Comment #15
nlowhor commentedAfter reading the new documentation, I was reminded of something and wonder if it could be in any way related to this issue. When I was first getting this module running, for some reason I couldn't get the settings.inc to work by calling it from settings.php so I just copied the contents into settings.php and it worked. I just looked at this and noticed there is stuff about sessions and form validation in there. I'm not familiar with how this whole process works so perhaps this little hack messed stuff up. I'll try to getting it working the correct way tonight and see if that changes anything.
Comment #16
Dave Cohen commentedSomething about the session name changed between 5.1 and 5.2 (or maybe it was 5.2 and 5.3). In any case, you're better off including that file, as it is bound to change. Look into PHP's include path and find a way to get it to read that file.
It would be great if that solved the problems.
Comment #17
nlowhor commentedAre you referring to version numbers for fb or for Drupal? I'm running Drupal 5.1 so I'll just go ahead and get that up to date as well.
Is there a difference in putting the code from settings.inc in settings.php and using the "require_once" line to get it in there? Does this have a different effect?
Boy, I hope this fixes things. Find out tonight.
Comment #18
Dave Cohen commentedI'm referring to Drupal version numbers.
It's better to include the code by referrence so that when it changes, you get the changes.
Comment #19
nlowhor commentedOk, I'm running Drupal 5.3 now and I got the include to work by referencing. I deleted my user from the db, uninstalled the app on Facebook, and reinstalled. Nothing has changed. Works, or doesn't work, just like before.
Strangely, it seems that at some point during development that the submission forms worked AND redirected like they are supposed to. I think next I might just delete the app, module, all associated table and start from scratch and see what happens. I don't know what I could've changed to break it, but perhaps this might offer some clue.
Comment #20
nlowhor commentedWell I wiped everything and created a new app.....same result. No idea what to try next.
Comment #21
nlowhor commentedWell, you're gonna kill me for wasting your time. I just reloaded fb.module and it works now. Apparently at some point I messed something up in there. I haven't had a chance to fully test stuff so let's leave this open a bit longer. I might bump into an issue because /user still doesn't load the current user. Perhaps that's a separate issue and I'll open a new thread if there's a problem there.
Anyway, I really appreciate the time you've spent trying to help. If this works, there's just a couple of other items to finish.
Thanks!
Comment #22
Dave Cohen commentedI was hoping this would somehow go away, since it seems like noone else has encountered it.
Just open this issue back up if it happens again.
Comment #23
nlowhor commentedOk, I found what caused this issue. I had applied the patch given at http://drupal.org/node/187955 so that my exposed views would work. This patch killed the redirection after form submission but works great for exposed views. :) I'll make a post over in the other thread to indicate it can cause issues.
Comment #24
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.