eZ upgrade - urlalias

Author Message

Heiner Wurbs

Friday 22 January 2010 9:08:52 am

Hello community,

I have a question concerning upgrading and url_alias: the upgrade from 3.9.3 to 4.2 works fine and at the end I have the glorious new URLs, but the old urls are not working any more. Example:

"/company/about" is now "/Company/About"

If I enter the old one "/company/about", the content is displayed, even it is the old url.

But if the example looks like:

"/company/where_we_are" is now "/Company/About/Where-we-are"

the Module not found page is displayed.

Any hints or ideas?

Heiner

Heiner Wurbs

Sunday 24 January 2010 1:33:59 am

There are some options in the transform.ini.

BUT: I want to use the new URLs and only as a fallback the old ones. So I suppose, the urlalias_compat is not the right Groups in Transformation.

Or, if this is not possible, is there an extension or solution to manage these old urls? Because they are still in the database ...

Nicolas Pastorino

Monday 25 January 2010 10:09:45 am

Hi Heiner,

This is a good question, and i must confess i called on eZ Engineering's help on that. We'll come back to you when we have the answer!

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Heiner Wurbs

Monday 25 January 2010 2:09:32 pm

Hi Nicolas,

that would be great! For now I made a hack of kernel/error/view.php:

I replaced the line "$errorRedirectURL = $errorINI->variable( 'ErrorSettings', 'DefaultRedirectURL' );" with the following:

$lost_uri = $_SERVER['REQUEST_URI'];
if ( strlen( $lost_uri ) > 0 and $lost_uri[0] == '/' )
$lost_uri = substr( $lost_uri, 1 );

$db = eZDB::instance();
$sql = "select * from ezurlalias where  ";
$sql .= "source_url LIKE '". $lost_uri    ."' ";

    $lost_uri_rows = $db->arrayQuery( $sql, array( 'offset' => 0, 'limit' => $limit ) );

    if ( count( $lost_uri_rows ) > 0) {
foreach ( $lost_uri_rows as $lost_uri_row )
{
$errorRedirectURL = $lost_uri_row['destination_url'];
}
eZDebug::writeError( "Hack: Found lost URI: " . $_SERVER['REQUEST_URI'] , "error/view.php" );
    } else {
        $errorRedirectURL = $errorINI->variable( 'ErrorSettings', 'DefaultRedirectURL' );
    }

I suppose, that the solution could be in a transformation, but I dont understand it :(

Heiner Wurbs

Monday 25 January 2010 2:17:58 pm

append:

[SiteSettings] 
ErrorHandler=displayerror

and in error.ini.append.php

[ErrorSettings-kernel]
# 20 - Module not found
ErrorHandler[20]=redirect

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 18 2025 04:58:33
Script start
Timing: Jan 18 2025 04:58:33
Module start 'layout'
Timing: Jan 18 2025 04:58:33
Module start 'content'
Timing: Jan 18 2025 04:58:33
Module end 'content'
Timing: Jan 18 2025 04:58:33
Script end

Main resources:

Total runtime0.0169 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.0050 587.9141152.6250
Module start 'layout' 0.00500.0036 740.539139.4453
Module start 'content' 0.00860.0062 779.984493.3672
Module end 'content' 0.01490.0020 873.351634.3047
Script end 0.0168  907.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002414.2582140.0002
Check MTime0.00116.3873140.0001
Mysql Total
Database connection0.00084.514710.0008
Mysqli_queries0.002414.392630.0008
Looping result0.00000.106110.0000
Template Total0.00169.510.0016
Template load0.00084.912110.0008
Template processing0.00084.574110.0008
Override
Cache load0.00063.535910.0006
General
dbfile0.001911.542780.0002
String conversion0.00000.060840.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