I've been working on an fb_tab for a while now and slowly getting there, but something very fundemental has occured to me. The fb_tab complex example here: http://drupal.org/node/956034 checks if the tab has been configured, if it has, it displays the tab. This only allows the opportunity to configure the tab once, at the very beginning.
If I want the owner of the tab to be able to go back and change the configuration of the tab later, can I just provide a link to set $data['config'] to NULL and refresh the tab so that it requires configuration again?
I'm just unsure of the implications of this, any pointers appreciated!
Comments
Comment #1
Dave Cohen commentedPresent the user with a link like this...
l('click to edit', fb_tab_config_url());Comment #2
problue solutionsDave,
Clicking that link results in "The requested page could not be found."
also tried fb_tab_config_url($data['profile_id']) and got the same result.
Comment #3
problue solutionsThe config URL is something like:
http://apps.facebook.com/myappname/fb_tab/config/183579735033391Whereas the link above goes to something like:
http://apps.facebook.com/myappname/%252Ffb_cb/201753026509914/fb_page/183579735033391/fb_tab/config/183579735033391Comment #4
Dave Cohen commentedLooks like a problem with url rewriting. It's weird to see "app.facebook.com" and also fb_cb/201753026509914. Its further weird to see %252F, I'm not sure what that is supposed to be.
Do you have anything else enabled that does url rewriting? Grep for url_rewrite to find out.
Comment #5
problue solutionsNo there's nothing else performing any url rewriting.
Just to clarify in case I'm doing something wrong...I've put
print l('click to edit', fb_tab_config_url());inside the FB_TAB_OP_VIEW operation, and I've just put that code in there as is, I haven't put it in as a markup value in the$return['eg_fb_og']array which displays the content of the tab when viewed, I don't think thats the problem but just checking.I really appreciate your continued support here!
Comment #6
problue solutionsCan anyone confirm that fb_tab_config_url() outputs the correct link to the configuration page when it's placed on a tab?
Comment #7
problue solutionsOk, everything must be output from this
$return['eg_fb_og']array (from the examples in the documentation),fb_tab_config_url()works fine but it must be a value of that array and can't be used anywhere on its own. Hopefully this will help some beginner folk who arent versed enough in Drupal to automatically know this :PNext problem! I only want to display the configuration link to the user who initially configured the tab, so I thought that would be pretty simple, something like:
I've used uid 3 in the example, its actually set to a $data['config']['eg_fb_og'] but thats not relevant to the problem, the print statement on the second line ALWAYS outputs 0, i.e. anonymous drupal user, no matter who is viewing the tab, users logged into drupal without the app installed, users logged into drupal with the app installed, the owner of the page with the app installed, doesnt matter who views the page, always $user->uid = 0.
if in the
FB_TAB_OP_FORMoperation:Results in the correct UID of the user viewing the tab.
if in the
FB_TAB_OP_VIEWoperation:Results in 0 no matter who is viewing the tab.
So my question is, how do I display the configuration link only if the user viewing the tab is the drupal logged in user who initially configured the tab?
Comment #8
Dave Cohen commentedFacebook does not let you learn much about the user until they interact with the tab. In practice I try to get users off tabs and onto canvas pages ASAP, because tabs have historically been hard to work with.
Facebook allow apps to specify an "edit url" for each tab, and I just checked and see the line specifying that is commented out in fb_tab.admin.inc. I commented out because I couldn't find it actually appearing anywhere. According to this thread there is a place to find it: http://forum.developers.facebook.net/viewtopic.php?id=88920
If you have time to test, please uncomment fb_tab.admin.inc line 18. Then sync properties for your app. Then see if that edit link becomes available. And please post here whether it works!
Comment #9
problue solutionsHi Dave,
I uncommented line 18 and synced properties, the tab edit URL seems to be blank though:
As far as I can see there is no tab edit link on the tab.
Comment #10
Dave Cohen commentedSorry, there's more commented out in fb_tab.admin.inc, at the very bottom look for "XXX" and uncomment that, then save the application again (not just sync props).
Comment #11
Dave Cohen commentedI haven't tested this, but made the change locally. Its a shame I ever commented this out, I literally could not find it anywhere in facebook's UI.
Comment #12
Dave Cohen commentedImproved patch. I'm not sure it works completely.
Comment #13
Dave Cohen commentedAlthough relatively untested, I've checked this in, as it should be in the next release candidate later today. Re-open this issue if still a problem.
Comment #14
problue solutionsDave,
I applied the patch and saved the app again, then synced props and the edit config url is now displayed as: fb_tab/config.
I don't see anything new on the tab though? Should there be an edit link displayed or what exactly does the patch do?
in #8 you mention "Then see if that edit link becomes available", where should the link be or how do I display it?
Comment #15
problue solutionsComment #16
Dave Cohen commentedhttp://forum.developers.facebook.net/viewtopic.php?id=88920
Comment #17
problue solutionsFollowing the directions in that post, when I click 'Go to App' the url is:
https://www.facebook.com/pages/edit/fb_tab/config?fb_page_id=174537389277774Nothing happens when I click the link, it's continually trying to do something (the firefox cursor throbber is moving) but the page doesnt load.
Comment #18
problue solutionsputting that url directly into the browser results in the Facebook internal 'page not found' message.
Comment #19
Dave Cohen commentedWhen I go to a page with a tab, then click "Edit Info", I see a page with lots of stuff. Under "Apps" I see my app. There's an "Edit" link that goes to http://apps.facebook.com/MYCANVAS/fb_tab/config?fb_page_id=4975168460, which is the URL that fb_tab.module configures.
Unfortunately it ignores the ?fb_page_id=4975168460. Other than that it works for me.
Comment #20
problue solutionsWhat I see is what they are discussing in the link you posted to facebook dev forum, click 'Edit Info' on a page, click 'Apps', I see my app with a 'Go to App' link, 'Edit Settings' link, and 'Link to this tab' link, it's not the same as the pic you have posted. See attached.
The 'Go to App' link URL I posted above does nothing, if put directly into the browser it says page not found.
Comment #21
problue solutionsAttached is a full screenshot showing that I am in the right place, and the available links are different to what you describe. Any ideas why this would be?
http://apps.facebook.com/MYCANVAS/fb_tab/config does indeed go to the edit page, just need to know how to make this available to the user.
Comment #22
Dave Cohen commentedMake certain you're using the latest .dev release. Edit your app, and make sure under "Facebook profile tabs" the edit url is set to fb_tab/config. Then submit (even if you haven't changed anything).
To double check the settings, follow the "remote settings" link to facebook.com. Click the Facebook Integration tab and see what the Edit URL is. Even if modules/fb is not automatically setting the value, you can enter it here manually.
Comment #23
Dave Cohen commentedIt's weird that none of the apps in your screenshot have the Edit link. Are you sure your account can administer all page settings?
Comment #24
problue solutionsyeah, this is what is confusing me, why do i see something different on the facebook user side than you do.
My facebook account is the account that created the page in the screenshot, so I would presume I can adminster all page settings.
Comment #25
problue solutionsI logged into facebook with a completely different username just to check it wasnt something strange with my account, and I see exactly the same thing as I described above.
Can anyone else chime in and describe what they see?
Dave, are you sure what you're looking at isnt a page visible only to the developer of the app or something?
Comment #26
Dave Cohen commentedI'm looking at the about page for an app. And I've added the app to that page. Here's pretty much the entire page. I don't think we're looking at the same thing.
Comment #27
problue solutionsDave, that isnt the 'edit info' page for the users facebook page, so the user wouldnt have access to the page you are talking about, meaning the configuration link is not available to them.
Comment #28
Dave Cohen commentedThat's right, it's for the page administrator. The application doesn't know who the user is, at least not until they click in the tab.
fb_tab.module helps you with page specific settings. For user-specific settings, you're on your own.
Comment #29
problue solutionsThe page administrator does not have access, you have added the app to the app's own page, meaning the app developer is the only one who has access to this edit link.
I have just confirmed this by doing the same thing and now I see the same as your screenshot, but the only reason I see this is because I've added the app to the app's own page, and because I'm the developer of the app I can access it. Every other user who adds the facebook tab to their page does not have access to this link if they click 'edit info' on their facebook page.
Furthermore, the 'Edit' link below my app (on a page that looks exactly the same as your screenshot), goes to the exact same URL as the 'Go to app' link I was talking about earlier:
http://www.facebook.com/pages/edit/fb_tab/config?fb_page_id=201753026509914This link does not work. However because its the same URL in both places it would suggest that each user can then access the config page by clicking 'Edit info' on their facebook page, and then 'Go to App' link, solving what I'm taking about above (each page admin should be able to do this and not just the page admin of the app page).
So in other words, if the link was working and going to the right place I think we'd be fine.
Yours goes to:
http://apps.facebook.com/MYCANVAS/fb_tab/configThis works when i paste directly in the browser
Mine goes to:
http://www.facebook.com/pages/edit/fb_tab/config?fb_page_id=201753026509914This goes nowhere
I've double checked everything on both the drupal and facebook sides, the config URL is set properly etc, baffling me why we have 2 totally different URLs for the 'Edit' link!
Comment #30
Dave Cohen commentedThe "www.facebook.com/pages/edit" In your URL is very suspicious. I don't think modules/fb is producing a url like that.
Click the remote settings link to edit the app settings on facebook. Click "Facebook Integration" and look for "Edit URL" at the bottom. I see "http://apps.facebook.com/dave-dforfb/fb_tab/config" in that field. The fully qualified URL. Maybe you only see "fb_tab/config"?
Make sure you're using the latest .dev code and save your app on drupal. It should set that value properly.
Comment #31
problue solutionsDave, that was exactly it...the config url in the Facebook Integration section was set to "fb_tab/config" which i assumed was what it was supposed to be, changing it to the fully qualified URL worked perfectly, all page administrators can now edit their tab settings by viewing their facebook page, click on "Edit info" > "Apps" > "Go to app" link below the facebook application.
Not sure why the config URL is not being set correctly from the Drupal side, but its a minor issue.
I'd be happy to contribute to the DFF documentation explaining the tab config on this page: http://drupal.org/node/956034
If you are ok with that let me know how I should do this.
Thanks for your continued attention and development of the module, much appreciated.
Comment #32
problue solutionsIm just wondering...
Under Home › Administer › Site building › Facebook Applications › Application Detail
Facebook profile tabs > Edit URL
help text says "Recommended value is fb_tab/config."
If this field was actually set to an absolute url "http://apps.facebook.com/APPNAME/fb_tab/config" instead of the relative url "fb_tab/config" then it might work without having to override the URL on the facebook side?
Comment #33
Dave Cohen commentedOn the drupal side, it should be "fb_tab/config". On the facebook side, it should be an absolute URL. THat's how it works on my copy. And I have a feeling if you update your modules/fb, that's how it will work for you.
Please update the doc! Any help with that is appreciated. You should be able to just edit that page. (Or maybe you need to apply to drupal.org infrastructure to get permission).
Comment #35
mottolini commentedI'm using version 3.1 and there is no more line 18 to uncomment, but I'm experiencing the same problem: the link from the apps list in the page edit (see picture attached) is not working.
The link "Go to app" is in the form http://apps.facebook.com/APPNAME/fb_tab/config?fb_page_id=PAGEID while should be http://apps.facebook.com/APPNAME/fb_tab/config/PAGEID