Forums / General / Default URI of deleted objects

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.

eZ debug

Timing: Jan 19 2025 06:20:06
Script start
Timing: Jan 19 2025 06:20:06
Module start 'content'
Timing: Jan 19 2025 06:20:07
Module end 'content'
Timing: Jan 19 2025 06:20:07
Script end

Main resources:

Total runtime0.7554 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.9453180.8438
Module start 'content' 0.00560.5926 769.7891559.8125
Module end 'content' 0.59820.1571 1,329.6016336.7578
Script end 0.7553  1,666.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4882210.0002
Check MTime0.00130.1737210.0001
Mysql Total
Database connection0.00080.110010.0008
Mysqli_queries0.685990.79901940.0035
Looping result0.00180.24421920.0000
Template Total0.729996.620.3649
Template load0.00220.296620.0011
Template processing0.727696.324220.3638
Template load and register function0.00010.012810.0001
states
state_id_array0.00060.085010.0006
state_identifier_array0.00100.134620.0005
Override
Cache load0.00190.2547340.0001
Sytem overhead
Fetch class attribute can translate value0.00110.148730.0004
Fetch class attribute name0.00110.141450.0002
XML
Image XML parsing0.00120.157030.0004
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00300.3937320.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs