Jump to:
| Project: | Drupal for Facebook |
| Version: | 6.x-3.4-rc2 |
| Component: | Facebook Connect |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
If a user with connected FB profile is on a page in your drupal project, where there are some query parameter in current URL (eg. "www.myproject.com/page-1?demoquery=1"),
AND the user is not logged in at the moment (acting as anonymous user)
AND if the user logs into facebook.com in another registercard of the browser,
THEN the automatized login of the FB-module takes place.
During this login, there is a reload of the current page (if no destination parameter is in current URL). But when the page gets reloaded, all query parameter get lost: "www.myproject.com/page-1" gets loaded.
This is a bug, I think.
Technical: there is a redirection to Drupal.settings.fb.reload_url paramter in JS. This parameter is set faulty with only $_REQUEST['q'] as path.
I fixed the part in fb.module by introducing an array $query; the changed lines are marked via // NEW
function fb_init() {
...
$query = array(); // NEW
if (isset($_REQUEST['destination'])) {
$destination = $_REQUEST['destination'];
}
elseif (isset($_REQUEST['q'])) {
$destination = $_REQUEST['q'];
$query = $_GET; // NEW
unset($query['q']); // NEW
}
else {
$destination = '<front>';
}
if (fb_is_canvas()) {
$destination = fb_scrub_urls($destination); // Needed?
}
// Stripping the fragment out to be tacked on during the javascript redirect
if (strpos($destination, '#') !== FALSE) {
list($destination, $fragment) = explode('#', $destination, 2);
fb_js_settings('reload_url_fragment', $fragment);
}
fb_js_settings('reload_url', url($destination, array(
'query' => $query, // NEW
'absolute' => TRUE,
'fb_canvas' => fb_is_canvas(),
'language' => (object) array('prefix' => NULL, 'language' => NULL), // http://drupal.org/node/1000452
)));
}
}
Comments
#1
#2
remark: I am using a fb_connect page, no canvas page and no tab.
#3
This looks good, thanks. Any chance you can make a proper patch?