Skip to content

Commit

Permalink
Fix a long standing bug on the 404 page.
Browse files Browse the repository at this point in the history
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
cdent committed Apr 12, 2012
1 parent bc3c404 commit ce42f63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/errors/errorHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ce42f63

Please sign in to comment.