Menu

#1 Component alias lookup fails on multisites (with solution)

open
nobody
None
5
2007-09-29
2007-09-29
Stzzo
No

OpenSEF Version: 2.0.0-RC5_SP2

PROBLEM:

When OpenSEF builds the list of component aliases in sef.php (~ line 30), it loads aliases for all sites and does not sort them. Because sefResolver::input() simply returns the first in the array with a matching alias, you don't necessarily get the one you wanted.

SUGGESTED SOLUTION:

1. Move the code in sef.php that determines the site (~ line 158) to precede the component alias lookup.

2. Change the query that selects the aliases to:

"SELECT * FROM #__opensef_sef_component WHERE `site_id` = {$sefSite->id} OR `site_id` IS NULL ORDER BY site_id DESC, ordering ASC"

As an interim fix, I'm including a core extension that replaces the sefResolver class. Change is that sefResolver::input() does a re-lookup of the alias list based on the site id, and orders the results so that site-specific aliases will override global aliases.

To use it, unzip and copy to /administrator/components/com_sef/extensions/

Discussion

  • Stzzo

    Stzzo - 2007-09-29

    Logged In: YES
    user_id=1364270
    Originator: YES

    File Added: core.resolver_cust.php.zip

     
  • Stzzo

    Stzzo - 2007-09-29

    Custom Resolver class to fix bug with multisite component aliases.

     
MongoDB Logo MongoDB