Permalink
Browse files

Fix a long standing bug on the 404 page.

The 404 page is only supposed to present a link to create a tiddler
or a links to possible other tiddlers you might be looking for if
in fact you are looking at a tiddler URI. Instead it was doing it
pretty much all the time. I think this was @jdlrobson , so pinging
him so he's aware.

Anyway, the change says to only present the tiddler info if:

* the path is only one segment long and is not 'bags' or 'recipes'
* the path is 4 segments long
  • Loading branch information...
1 parent bc3c404 commit ce42f633b67bfcecb7e671c93a9490799904c55f @cdent cdent committed Apr 12, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/errors/errorHandling.js
@@ -31,7 +31,13 @@ var errorhandler = {
if(path) {
var segments = path.split("/");
var tiddler = segments[segments.length - 1];
- if(tiddler) { // currently only for for tiddler uris
+ var bagsP = $.inArray('bags', segments);
+ var recipesP = $.inArray('recipes', segments);
+ var segmentsCount = segments.length;
+ if ((segmentsCount == 1
+ && bagsP == -1
+ && recipesP == -1)
+ || segmentsCount == 4) {
errorhandler.suggestTiddlers(container, space, tiddler);
}
} else {

0 comments on commit ce42f63

Please sign in to comment.