In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0001026 [In-Portal CMS] Front End bug report always 2011-03-13 18:03 2011-09-19 16:08
Reporter Dmitry View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Fixed in Version 5.1.3-B1
Status closed Product Version 5.1.0 Target Version 5.1.3
Time EstimateNo estimate
Summary 0001026: Impossible to get "404 Not Found" page with Rewrite Listeners
Description In new rewrite listener engine it's near to impossible to get 404 Not Found page in case if at least one part of url was interpreted by rewrite listener. For example in if have urls in format "/friends/<friend_name>" (friend detail page) and we have "/friends" (friend list). At parsing start we look for "friends" at url start if so, then appropriate FriendRewriteListener begins to parse. If there are no more url parts, then show list. If there is more part, then threat it as friend name and display it's page. In case if friend not found we should normally display "404 Not Found", but instead we do nothing and assuming, that next rewrite listener will take care of that, because it really could do that, who knows.

For example: and will lead to the same page and Google doesn't like that.

Proposed Solution

To solve this problem I propose to let rewrite listener mark url parts, that are processed by it (part order number). At the end in case if total processed part count doesn't match count part in url we will automatically show 404 Not Found page.
Additional Information
Tags No tags attached.
Change Log Message Fixed ability to show "404 Not Found" page
Estimate Points 0
Attached Files patch file icon raise_404_on_partial_url_parse_too.patch [^] (6,342 bytes) 2011-05-20 04:39 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
child of 0000098closed (5.0.1)alex Redo Mod-Rewrite for Better Flexibility 

-  Notes
User avatar (0003439)
alex (manager)
2011-05-20 03:30

Url parsing issues:
1. there could be duplicate url parts (e.g. url "/test/page/test/another-page" has "test" part listed 2 times but under different position) - we need to keep part index too
2. different rewrite listeners could parse same url part and mark it as parsed (so total parsed part count may be correct, but it won't mean, that all url parts are parsed)

Remembering url part original index is a problem, since rewrite listeners usually remove parsed url parts resulting original part indexes to be shifted.

Any ideas?
User avatar (0003440)
alex (manager)
2011-05-20 03:37

We can simplify that problem, by presuming, that parsed url parts are always removed, so no other rewrite listener could get them.

In that case duplicate url part parsing isn't a problem anymore, since 1 part is processed by 1 rewrite listener only and then it's removed. And total processed part count would do the trick.
User avatar (0003441)
alex (manager)
2011-05-20 04:42

Usage is simple:

from your rewrite listener execute this:

$mod_rw_helper =& $this->Application->recallObject('kModRewriteHelper');
/* @var $mod_rw_helper kModRewriteHelper */

$mod_rw_helper->partParsed( 'url-part-that-was-parsed' );

Pass 'rtl' as 2nd parameter, when url parsing in this rewrite listener is done from right to left.
User avatar (0003463)
Dmitry (manager)
2011-05-22 20:53

Reviewed and tested good, please commit!
User avatar (0003484)
alex (manager)
2011-05-23 02:50

Fix committed to 5.1.x branch. Commit Message:

Fixes 0001026: Impossible to get "404 Not Found" page with Rewrite Listeners
User avatar (0003852)
alex (manager)
2011-09-19 16:08

Closing, since 5.1.3 release has been released.

- Related Changesets
In-Portal CMS: 5.1.x r14342
Timestamp: 2011-05-23 02:50:40
Author: alex
Details ] Diff ]
Fixes 0001026: Impossible to get "404 Not Found" page with Rewrite Listeners
mod - /in-portal/branches/5.1.x/core/units/helpers/mod_rewrite_helper.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2011-09-19 16:08 alex Note Added: 0003852
2011-09-19 16:08 alex Status resolved => closed
2011-05-23 02:50 alex Note Added: 0003484
2011-05-23 02:50 alex Status reviewed and tested => resolved
2011-05-23 02:50 alex Fixed in Version => 5.1.3-B1
2011-05-23 02:50 alex Resolution open => fixed
2011-05-23 02:50 alex Changeset attached 5.1.x r14342
2011-05-22 20:53 Dmitry Note Added: 0003463
2011-05-22 20:53 Dmitry Assigned To !COMMUNITY => alex
2011-05-22 20:53 Dmitry Status needs testing => reviewed and tested
2011-05-20 04:42 alex Time Estimate Removed 3 =>
2011-05-20 04:42 alex Note Added: 0003441
2011-05-20 04:42 alex Assigned To alex => !COMMUNITY
2011-05-20 04:42 alex Developer => alex
2011-05-20 04:42 alex Status needs work => needs testing
2011-05-20 04:39 alex File Added: raise_404_on_partial_url_parse_too.patch
2011-05-20 03:37 alex Note Added: 0003440
2011-05-20 03:30 alex Note Added: 0003439
2011-05-18 13:22 Dmitry Time Estimate Added 3
2011-05-18 13:22 Dmitry Assigned To => alex
2011-05-18 13:22 Dmitry Status active => needs work
2011-04-04 11:53 Dmitry Target Version Icebox => 5.1.3
2011-03-14 02:10 alex Relationship added child of 0000098
2011-03-13 18:03 Dmitry New Issue
2011-03-13 18:03 Dmitry Reference =>
2011-03-13 18:03 Dmitry Change Log Message => Fixed ability to show "404 Not Found" page

Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker