URL Aliases have no effect in ezP 4.0

URL Aliases have no effect in ezP 4.0

Thursday 10 April 2008 6:55:49 am - 4 replies

Modified on Thursday 10 April 2008 6:57:11 am by Felix Leimbach

Author Message

Kristof Coomans

Thursday 10 April 2008 10:31:59 am

Hi Felix

I can not reproduce the issue that occurs there, but I'm using a fresh installation. Could you report this problem in the issue tracker please and provide us a dump of the database? Thanks!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Felix Leimbach

Thursday 10 April 2008 12:05:47 pm

Hey Kristof,

thanks for looking - created issue http://issues.ez.no/IssueView.php?Id=12845
About the DB dump:
The DB is quite large and should be kept semi-confidential at least :)
Is it enough for you to have the ezurlalias and ezurlalais_ml tables?

Felix Leimbach

Saturday 12 April 2008 12:01:30 am

Spent an evening debugging this stuff and here's the result with a preliminary fix which Works For Me (TM). Someone from the eZ crew should look into my fix, because it may be too simplistic or even plain wrong for general use.

Anyway, here are my findings:
File #1 /index.php:
a) The code does run into the if clause of below the comment "Check for URL translation". It does fill $translateResult correctly and sets $objectHasMovedError to true as expected
b) On line around #702 it calls:
$module->handleError( eZError::KERNEL_MOVED, 'kernel', array( 'new_location' => $objectHasMovedURI ) );

The $module seems to be error-module, so that leads us to file #2 kernel/error/view.php:
a) $errorHandlerType is set to 'redirect' here
b) Thus it enters the if-clause at around line #105 where it redirects to the 'ErrorSettings' => 'DefaultRedirectURL' !!! Which is of course non-sense, as we have been given a NEW LOCATION and should not use the DefaultRedirectURL from the INI settings

Instead of entering the if-clause at line #105 I made it enter the if-clause above at #78 which does issue a HTTP 301 (moved permanently). I realize that a HTTP code is probably not what was intended for the url_alias scenario, but it does the job for now until this gets eZ's attention.

Patch is attached to the issue linked in my previous post.

Felix Leimbach

Friday 13 February 2009 12:37:40 pm

OK, bug is fixed after upgrading from 4.0.0 to 4.0.2
Had to re-create the URL alias, though.

You must be logged in to post messages in this topic!

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