Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18686

PathPrefix is not removed from url by ezpLanguageSwitcher

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 4.2011
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System:Debian
      PHP Version: 5.3.3
      Database and version:
      Browser (and version): Firefox 6.0.2

      Description

      When a PathPrefix setting is set in the destination siteaccess , the destinationUrl() function in the ezpLanguageSwitcher class does not remove the PathPrefix from the $urlAlias variable.

      I used the following workaround in kernel/private/classes/ezplanguageswitcher.php :

      public function destinationUrl()
      {
      .....
      $urlAlias = $destinationElement[0]>getPath( $this>destinationLocale, $siteLanguageList );

      // remove pathPrefix from url
      $sitePathPrefix = $saIni->variable( 'SiteAccessSettings', 'PathPrefix' );
      $urlAliasArray = explode ( '/' , $urlAlias);

      if ( in_array($sitePathPrefix,$urlAliasArray) )

      { unset($urlAliasArray[0]); $urlAlias = implode('/',$urlAliasArray); }

      ......
      }

      It would be a good idea to have the pathPrefix automatically checked by the languageswitcher in future versions.

      Steps to reproduce
      • create multiple siteaccess with differents ContentObjectLocale
      • specify a PathPrefix in each siteaccess
      • translate an object
      • use the /switchlanguage/to/$destinationSiteaccess/$node_id function to get the url alias of a node in the destination siteaccess

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              unknown unknown
              Reporter:
              supasteevo Steven Bressey
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: