Default URI of deleted objects

Author Message

Russell Michell

Sunday 28 September 2008 3:36:48 pm

Hi there folks,

Am I the only one that thinks the default eZ behaviour for linking to deleted content-objects is a little odd?

* Create an Article called "Test", then publish it.
* In any other existing Article object, add a link via the online editor to the Article "Test" then publish it.
* Rename "Test" - the link to it in the existing Article is updated. Fine, all good.
* Move "Test" to another folder - the link to it in the existing Article, is updated. Fine, all good.
* <b>But</b> Delete "Test" to the Trash - the link to it in the existing Article, is updated - but to the default SiteURL?

Is it possible to change the default location that links to deleted objects point to, and leave them as-is so that when you run something like runcronjobs.php, the link results in "invalid" being returned so it can be flagged as something that site-admins/editors need to check and fix?

Cheers,
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Mark Marsiglio

Sunday 28 September 2008 6:57:51 pm

Try changing your error.ini settings. The settings that I use most often are:

[ErrorSettings]
DefaultErrorHandler=rerun
DefaultRedirectURL=/content/view/error/2
DefaultRerunURL=/content/view/error/2

ErrorHandler[20]=rerun
RerunURL[20]=/content/view/error/2

This results in the url staying the same, and 404 headers being sent to the user. We set up a custom override on the error view to show the sitemap and a search field so that the user can find the page that they were looking for. However, it will come back as an invalid link when you run an external checker on it.

The internal link checker will not pick this up because it does not check eznode urls. However, if you have pages linked using the regular format of url (i.e. /folder/subfolder/page_name) either in relative or absolute format, the link checker should pick up the problem.

To avoid dead link problems when deleting pages that are connected via eznode:// links, we recommend to our content managers that they check the Reverse Relations that the page has (using the admin interface) before deleting a page to see what other pages link to it, or have it embedded.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Russell Michell

Monday 29 September 2008 3:46:13 pm

Hi there and thanks Mark,

I take your point with regard to ensuring deleted items no longer have reverse-linked items, but do you find this method works for links that point to items that have just been placed in the trash?

What I mean is, once you access a page which used to link to a content-object but has just been removed to the trash, all URIs pointing to it seem to be auto-updated to what appears to be SiteURL from site.ini. How do you reconfigure eZ to change this URI?

In override/error.ini.append.php if I use:

[ErrorSettings]
DefaultErrorHandler=displayerror

If I now punch in a non-existent URL - I get the eZ default "Module Not Found" error (Error 20). But if I select the link that used to point to a normal content object (An Article for instance) but has since been moved to the trash, the link itself becomes updated - no eZ error, the link simply changes and becomes SiteURL.

The same if I use your solution for override/error.ini.append.php

DefaultErrorHandler=rerun
DefaultRedirectURL=/content/view/987
DefaultRerunURL=/content/view/987
ErrorHandler[20]=rerun
RerunURL[20]=/content/view/987

Or am I totally misunderstanding something (It wouldn't be the first time!)
Cheers,
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

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 19 2025 06:27:42
Script start
Timing: Jan 19 2025 06:27:42
Module start 'layout'
Timing: Jan 19 2025 06:27:42
Module start 'content'
Timing: Jan 19 2025 06:27:43
Module end 'content'
Timing: Jan 19 2025 06:27:43
Script end

Main resources:

Total runtime1.1217 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.1484152.6250
Module start 'layout' 0.00480.0028 741.773439.4453
Module start 'content' 0.00761.1128 781.2188554.7344
Module end 'content' 1.12040.0013 1,335.953116.1641
Script end 1.1217  1,352.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2773160.0002
Check MTime0.00130.1195160.0001
Mysql Total
Database connection0.00070.065810.0007
Mysqli_queries1.070995.4698570.0188
Looping result0.00050.0419550.0000
Template Total1.092797.420.5464
Template load0.00210.187420.0011
Template processing1.090697.222620.5453
Template load and register function0.00010.007810.0001
states
state_id_array0.00090.078410.0009
state_identifier_array0.00100.090520.0005
Override
Cache load0.00170.1523340.0001
Sytem overhead
Fetch class attribute can translate value0.00040.033620.0002
Fetch class attribute name0.00090.082750.0002
XML
Image XML parsing0.00090.077220.0004
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00090.0816210.0000
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs