I use this hook on my website to alter the redirect URL according to user's language preference saved in his profile.

Example is provided in simple_fb_connect.api.php. E.g. in a multi-language Drupal site with English and French enabled, if user has set French as preferred language in his Drupal account, and the current UI language is English, after login with Simple FB Connect, the UI language is switched from English to French. FYI, Drupal core default is to keep the current UI language.

Comments

francoisb created an issue. See original summary.

francoisb’s picture

Status: Needs work » Needs review
francoisb’s picture

Issue summary: View changes
masipila’s picture

Status: Needs review » Needs work

Hi,

I tested patch now but it only works correctly in the scenario that some module is actually modifying the $path and $options. If no module is implementing the new hook, these will be NULL and an error occurs.

Could you please fix the patch and test the following scenarios:

  1. No module implements the new hook: user creation
  2. No module implements the new hook: user creation so that user is redirected to the user form in module settings
  3. No module implements the new hook: user login so that user is redirected to the path defined in module settings
  4. No module implements the new hook: user login so that user is redirected to the path defined in ?destination query parameter
  5. Your own tests when a module is implementing the new hook

Cheers,
Markus

francoisb’s picture

I'm back to business…

Nice catch. You're correct. I should enclose my new code into a

if (count(module_implements('simple_fb_connect_redirect_url')) > 0) {
…
}

like is already done above for hook simple_fb_connect_scope_info.

I will fix, test, and upload new patch.

francoisb’s picture

StatusFileSize
new4.74 KB

Done. All 5 scenarios tested.

Can you take a look and approve ? Probably is good time now to also release a new minor version of the module (7.x branch), since many changes have accumulated.

francoisb’s picture

Status: Needs work » Needs review
francoisb’s picture

@masipila Friendly ping. Can you review ?

masipila’s picture

Hi,

I'll try to find time to review and test this next weekend. All my contributing time has gone to core Migrate API lately.

Cheers,
Markus

masipila’s picture

StatusFileSize
new1.8 KB

Hi,

I finally took the time to review and test this. Apologies for the late response!

I made some minor changes to #6, see interdiff attached. The control structures conditions are allowed to exceed 80 characters in Drupal coding standards if they are simple and easy to read as they are here.

I'll cut a new release for 7.x-2.x still today.

Cheers,
Markus

masipila’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.