SMF integration and problems with return urls
adamsjd
Joined: 2005-04-02
Posts: 21 |
Posted: Wed, 2005-05-11 11:19 |
edit by moderator: A am having trouble with this GET variable in the URL of my partially embedded G2 as well. The URL that it gives me has the g2_return variable that if I remove, causes the page to work fine.... (note that unless you are logged into my main site you won't have permissions to add a comment, and Embedded Gallery doesn't seem to handle it all that well) Seperate to this I also have an issue with a chdir() error when ever I try to use ImageMagik. I have tried turning on debugging but don't get any furhter information. When I run the test on the ImageMagik module I get the following... Quote:
chdir() : No such file or directory (errno 2) Gallery version = 2.0-beta-2+ core 0.9.16 Quote:
|
|
Posts: 32509
adamsjd, i fail to see the connection to the prior posts in this topic? can we split your post from this thread to form a new topic?
plus, could you define what "partially embedded" means and what exactly embedded Gallery doesn't handle too well?
thanks.
Posts: 21
You can, I posted because it was the g2_return= parameter variable in the URL that breaks my embedded application. Feel free to split.
Posts: 32509
adamsjd, ah sorry. that was obviously also the problem in the topic. you're right, lets discuss your problem here.
could you describe what "doesn't work" means? does the site just not load at all?
and if you perhaps could give as a test account that has the ability to create comments, then we could see the problem for ourselfs.
plus: what about G2 standalone? do the urls with the return parameter work in g2 standalone?
Posts: 21
valiant, here are the details.
I have started to try to embed G2 into my SMF forums. I have upgraded with the latest CVS and created the functions to init gallery and sync users.
When I run Gallery stand alone ( http://www.outersurf.com/gallery/ ) I have no problem with the g2_return value. When I run it embeded ( http://www.outersurf.com/?action=gallery ) the g2_return value seems to break. Let me give you an example.
Go to http://www.outersurf.com and login with
:asdf33@adf.com
Click on the Users Photo Albums link on the left menu. Then use the drop down menu to try to add a comment.
You will notice that rather than taking you to a page to enter a comment it just displays the gallery album that it was on before the comment.
If you remove the g2_return variable out of the URL it does show you the add comment field.
Posts: 32509
hmm, can i see your integration code?
i guess the problem could be there.
make sure to have something like this around your handleRequest() call:
Posts: 21
Posts: 32509
adamsjd, ok. but you didn't show what you do after you call _gallery_handle_request().
Could you show that code too? Or just add the snippet from my last post.
a note on your init code:
you'll only have to call GalleryEmbed::isExternalIdMapped(...) if you receive an error status on GalleryEmbed::init.
You save at least one db query / request that way.
Posts: 21
valiant, I added the bit of code as required for upload and binary transfers....
The actual code that is used to in the emApp is as follows
Posts: 32509
hmm, strange. can't explain why the return redirects don't work.
a few notes:
- why does an embedded G2 request on your site call http://www.outersurf.com/sundaysnap/variables.php ?
- in your function _gallery_handle_request(), make sure to adapt my code snippet a little. this code shouldn't be called anytime, but still, you should do something else than just copy $data into your code. (you don't use it anywhere).
do you use something like output buffering or so?
Posts: 21
valiant,
- your code has been adopted
- http://www.outersurf.com/sundaysnap/variables.php is where some variables are held for a the flash file on the left hand side, where did you see reference to this file?
- yes my emApp uses output buffering (as far as I know)
Posts: 32509
this output buffering could be the reason for your problem.
- either deactivate output buffering for the G2 module
- or what you could try: if isDone == true , then call ob_end_flush or ob_end_clean(); and after that exit;
don't know if that works.
Posts: 21
valiant I tried the flushing without any luck.
What is the g2_return used for? Is it the url that is returned to after the action (such as adding a comment) is completed?
I'm not sure how buffering would cause Gallery to not understand the required action the URL if there is a g2_return. I can use the exact same URL without the g2_return and it works like a charm.
The following two links demonstrate the problem, no login required.
http://www.outersurf.com/index.php?action=gallery&g2_view=core:ItemAdmin&g2_subView=comment:AddComment&g2_itemId=39542&g2_return=http%3A%2F%2Fwww.outersurf.com%2Findex.php%3Faction%3Dgallery%26g2_view%3Dcore%3AShowItem%26g2_itemId%3D39537&g2_returnName=album
vs.
http://www.outersurf.com/index.php?action=gallery&g2_view=core:ItemAdmin&g2_subView=comment:AddComment&g2_itemId=39542&g2_returnName=album
Update: interstingly this URL works, so it is something at the end of the g2_return URL
http://www.outersurf.com/index.php?action=gallery&g2_view=core:ItemAdmin&g2_subView=comment:AddComment&g2_itemId=39542&g2_return=http%3A%2F%2Fwww.outersurf.com&g2_returnName=album
Posts: 21
any thoughts on how I can go about trying to debug why the last part of the g2_return url causes G2 to not display the proper module?
Posts: 8601
Either your webserver/php or your G2 embed code is causes query parameters in your urls to be urldecoded twice.. we expect g2_return to be urldecoded so the value is the whole url.. this is not happening.. instead the url is urldecoded once and then processed into the parameters for the request. Example:
http://www.outersurf.com/index.php?action=gallery&g2_view=core:ItemAdmin&g2_subView=comment:AddComment&g2_itemId=43354&g2_returnName=album&g2_return=http%3A%2F%2Fwww.outersurf.com%2Findex.php%3Faction%3Dgallery%26g2_view%3Dcore%3AShowItem%26g2_itemId%3D43321%26g2_page%3D2
We expect these parameters:
g2_view = core:ItemAdmin
g2_subView = comment:AddComment
g2_itemId = 43354
g2_returnName = album
g2_return = http://www.outersurf.com/index.php?action=gallery&g2_view=core:ShowItem&g2_itemId=43321&g2_page=2
Instead we get:
g2_view = core:ShowItem (2nd value overwrites first, I guess)
g2_subView = comment:AddComment (ignored since ShowItem doesn't use subView)
g2_itemId = 43321
g2_page = 2
g2_return = http://www.outersurf.com/index.php?action=gallery (I think)
You'll need to track down why this is happening.
If we compensate for the problem by urlencoding twice, it works:
http://www.outersurf.com/index.php?action=gallery&g2_view=core:ItemAdmin&g2_subView=comment:AddComment&g2_itemId=43354&g2_returnName=album&g2_return=http%253A%252F%252Fwww.outersurf.com%252Findex.php%253Faction%253Dgallery%2526g2_view%253Dcore%253AShowItem%2526g2_itemId%253D43321%2526g2_page%253D2
(not a solution of course, just evidence..)
Posts: 21
Had to change
into
in the core of the emApp applitcation. seemed to work. Thanks for all the help in tracking down the issue.