Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I had a problem with the links in the facebook canvas pages redirecting back to the website when using pathauto. I solved this by adding $options['alias'] = $path; at the end of the fb_url_outbound_alter, bypassing the normal path's alias.
Comment | File | Size | Author |
---|---|---|---|
#8 | fb-1084946-path-prefixes-2.patch | 1.19 KB | Steven Jones |
#4 | fb-1084946-path-prefixes.patch | 1.06 KB | Steven Jones |
#1 | fb_url_rewrite.patch | 773 bytes | blup |
Comments
Comment #1
blup CreditAttribution: blup commentedI also had to add another condition to the function in case the fb_url_alter option is not set, otherwise it'll rewrite all aliases. I've attached a patch.
Comment #2
Dave Cohen CreditAttribution: Dave Cohen commentedThere may be a bug that needs fixing, but that fix is not it. You're just stopping it from doing what it is trying to do.
I haven't reproduced this myself and at this point can't offer something more helpful. But just looking at that patch I can tell that's not the right thing.
Comment #3
blup CreditAttribution: blup commentedWell, when you look at the url() function, if there are existing (pathauto) aliases they will take precedence over rewritten links. Thus I believe you should define your path as an alias.
Line #2142 of common.inc :
Comment #4
Steven Jones CreditAttribution: Steven Jones commentedRight, this is because FB module is working around a bug in Drupal core, so it can work with multilingual sites, but the bug nasty, and should just fixed in the core, because the workaround doesn't work for paths with an alias. Attached is a patch that reverts to the correct way of doing things in the FB module, and I'll file a patch for Drupal core.
Note that PURL has the same issue here: #1256272: No URL rewriting in Purl for D7
Comment #5
Steven Jones CreditAttribution: Steven Jones commentedI've raised the bug in Drupal core: #1270894: Test that it is possible to use path prefixes in combination with language prefixes
And have a sandbox project which implements a workaround for those that don't want to patch core: http://drupal.org/sandbox/darthsteven/1270906
Both largely untested.
Comment #6
Dave Cohen CreditAttribution: Dave Cohen commentedAre you saying I should apply #4, and it will work whether core gets patched or not?
Or, do I have to wait for the core patch before applying this?
So frigging confusing...
Comment #7
Steven Jones CreditAttribution: Steven Jones commentedNah, if you apply patch 4, and are using language specific URL re-writing from core, then it won't work.
But, you can either apply the patch, or use the workaround in the sandbox to get it working again.
Comment #8
Steven Jones CreditAttribution: Steven Jones commentedActually the previous patch generates a notice. Correction attached, note that these no longer apply to HEAD, but do apply to: c592885cb7d1c46fb005afd34d35211d410c4b1a.
Comment #9
aliyayasir CreditAttribution: aliyayasir commentedwhat about D6 patch?
Comment #10
dariogcode CreditAttribution: dariogcode commentedI'm using the last 7 dev version and path aliases aren't working, all path inside canvas page show original path, not aliases. Do you have any ideas what I need to patch and where?
Comment #11
Dave Cohen CreditAttribution: Dave Cohen commentedThis is an old thread, and if I understand Steven Jones' comments correctly, it can't be fixed in modules/fb alone and requires a change to core. Is that right?