[BUG?] uri matching and elements > 1

Author Message

Christian Rößler

Tuesday 09 March 2010 2:36:15 am

Hi,

I am about to setup a site using a mix of 2 access-types:

  • host based access using mapping
  • uri based access using elements

So i want to reach different siteaccesses the following way:

  • admin-de.example.com -> admin_DE
  • admin-en.example.com -> admin_EN
  • example.com/germany/de -> germany_de
  • example.com/germany/en -> germany_en

Everything is working as expected, using the following override-site.ini statements:

-------------------------------
[SiteAccessSettings]
CheckValidity=false
ForceVirtualHost=true

MatchOrder=host;uri
AvailableSiteAccessList[]=admin_DE
AvailableSiteAccessList[]=admin_EN
AvailableSiteAccessList[]=germany_de
AvailableSiteAccessList[]=germany_en
AvailableSiteAccessList[]=finland_fi
AvailableSiteAccessList[]=finland_en

HostMatchType=map
HostMatchMapItems[]
HostMatchMapItems[]=admin-de.example.com;admin_DE
HostMatchMapItems[]=admin-en.example.com;admin_EN
URIMatchType=element
URIMatchElement=2
----------------------------------

With the settings above, I am able to visit the siteaccesses as defined and described.
The URIMatchType element plus utilizing URIMatchElement=2 converts the request-Uri from '/germany/de/products/shoes/123' to the following Siteaccess-name: 'germany_de'.

Everything is fine 'til here. Now the (possible) Bug:

When creating links to contentobjects using the template-function ezurl, the followign links are being generated:
-----------
{"/content/view/ful/123"|ezurl} template code
/germany_de/content/view/full/123 output in html
/germany/de/content/view/full/123 output in html that is correct but not generated :-(
-----------
Am i missing something? The implementation of the following file/method seems not to take into account, that when using uri-type-matching plus using elements and elements being > 1, to reproduce a correct siteaccess-uri, not the siteaccess-directory-name. I implemented a workaround for this particular problem as below:

/lib/ezurils/classes/ezsys.php, method indexFile, around line 530, ezpublish 4.2.0
-------------------------------
if ( $withAccessList and count( $instance->AccessPath ) > 0 )
{
//$accessPath = implode( '/', $instance->AccessPath ); <--- original code
$accessPathArray = $instance->AccessPath; <-- added
$accessPathArray[0] = str_replace( '_', '/', $accessPathArray[0] ); <- added
$accessPath = implode( '/', $accessPathArray ); <-- added
...
...
-------------------------------

edit: added the function name, line and ez-version

Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 23:51:59
Script start
Timing: Jan 29 2025 23:51:59
Module start 'layout'
Timing: Jan 29 2025 23:51:59
Module start 'content'
Timing: Jan 29 2025 23:51:59
Module end 'content'
Timing: Jan 29 2025 23:51:59
Script end

Main resources:

Total runtime0.0203 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.2500151.2266
Module start 'layout' 0.00560.0027 739.476636.6797
Module start 'content' 0.00840.0104 776.156390.2656
Module end 'content' 0.01880.0015 866.421929.9922
Script end 0.0203  896.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002311.1013140.0002
Check MTime0.00104.8952140.0001
Mysql Total
Database connection0.00073.427310.0007
Mysqli_queries0.003919.101430.0013
Looping result0.00000.063310.0000
Template Total0.00115.210.0011
Template load0.00094.341810.0009
Template processing0.00020.820810.0002
Override
Cache load0.00073.280710.0007
General
dbfile0.003818.702780.0005
String conversion0.00000.035240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs