Page 1 of 1
Entry disappeared after editing
Posted: Sat Nov 13, 2010 3:04 pm
by onli
An entry I wrote was alright. Then I edited it, i added an alt-tag to the image. After the edit, the entry is still visible on the frontpage, but "can't be found" when trying to view the entry directly.
Frontpage,
entry.
I have no idea how to debug this as i never saw anything like that happen with s9y before. An id-mixup in the database caused by the edit? Wrong permalinks caused by the edit, a new one created but the old one still linked?
Re: Entry disappeared after editing
Posted: Sat Nov 13, 2010 3:40 pm
by Timbalu
Ich schätze mal das liegt daran, dass dein Titel mit einer Zahl anfängt...., denn
http://www.onli-blogging.de/index.php?/ ... l#comments
funktioniert. Wer da allerdings dazwischenfunkt, kann wohl am ehesten Garvin herausfinden
Ian
oops sorry für deutsch----
Re: Entry disappeared after editing
Posted: Sat Nov 13, 2010 4:59 pm
by onli
Danke. Darauf wär ich nie gekommen.
It seems like not the edit is responsible but the number in the title is.
Re: Entry disappeared after editing
Posted: Sun Nov 14, 2010 11:34 am
by garvinhicking
Hi!
You are missing a distinct entry URL "archives path" prefix like "entries". Since you don't have it, the URL pattern matches your URL as a ID of another entry...
Regards,
Garvin
Re: Entry disappeared after editing
Posted: Sun Nov 14, 2010 12:36 pm
by onli
Hi Garvin
I dont properly understand why. The id of the entry has its own place in the url, shouldn't that be discoverable (as the URL-Pattern is known)?
"Pfad zu den Einträgen" is set to archives. I added archives to the front of the url, so it looked like
http://www.onli-blogging.de/index.php?/ ... esden.html. But that didn't solve the issue and also breaks all old link (
http://www.onli-blogging.de/index.php?/ ... laert.html !=
http://www.onli-blogging.de/index.php?/ ... laert.html) - so that's no solution.
The archives-keyword needs another place in the url and the forwarding via .htaccess needs to be done manually?
Edit: Taking my permalink-structure into my testblog. In the index.php is the following pattern:
Code: Select all
@(([0-9]+)/[0-9a-z\.\_!;,\+\-\%]+\.html)/?@i
which is compared to the url via:
Code: Select all
preg_match(PAT_PERMALINK, $uri, $matches)
Taking for example:
Code: Select all
/index.php?/4/100-testeintrag.html
matches [0] becomes:
and matches[1]:
Why 100? The regexp isn't selecting the numbers before the -, it is selecting the numbers before the /. Or it is selecting the whole link, depends on what counts as first bracket. I think something is wrong here.
Edit2: Got it. It's the wrong pattern. PAT_COMMENTSUB is the one which gets true before.
Code: Select all
@/([0-9]+)[_\-][0-9a-z\.\_!;,\+\-\%]*\.html@i
Hm, maybe i can change that...
Edit 3:
If i simply change the order of the if, execute the match against PAT_PERMALINK first, everything seems to work (line 254/255 in index.php). Is there maybe a way to make that less errorprone generally? Probably adding archives/ like it used to be didn't work because even than, preg_match with PAT_COMMENTSUB returned true.
So that's really a bug - is changing the order a proper patch?
Re: Entry disappeared after editing
Posted: Mon Nov 15, 2010 12:07 pm
by garvinhicking
Hi!
Hm, I thought we already had means in place that would catch the permalink archives pattern before commentsub takes place. Sadly I'm currently lacking the time to investigate this thoroughly - maybe you can remind me of it next week?
Regards,
Garvin
Re: Entry disappeared after editing
Posted: Thu Mar 17, 2011 11:10 am
by onli
*remind* ;)
Re: Entry disappeared after editing
Posted: Sat Dec 10, 2011 1:21 pm
by onli
Hi
I just stumbled over this bug again,
http://www.onli-blogging.de/index.php?/ ... ssung.html vanished. Totally forgot my patch after the last s9y-update. Can we fix this in core?
Re: Entry disappeared after editing
Posted: Sat Dec 10, 2011 2:17 pm
by Timbalu
Hi Malte
You have GIT access haven't you?
If not, tell me what to change.
Re: Entry disappeared after editing
Posted: Sat Dec 10, 2011 3:19 pm
by onli
Code: Select all
diff -Nur Downloads/index-1.6.php Downloads/index.php
--- Downloads/index-1.6.php 2011-12-10 15:16:39.425894289 +0100
+++ Downloads/index.php 2011-12-10 13:25:57.505896370 +0100
@@ -251,8 +251,8 @@
}
echo $data;
-} else if ( (preg_match(PAT_COMMENTSUB, $uri, $matches) ||
- preg_match(PAT_PERMALINK, $uri, $matches) ||
+} else if ( (preg_match(PAT_PERMALINK, $uri, $matches) ||
+ preg_match(PAT_COMMENTSUB, $uri, $matches) ||
isset($serendipity['GET']['id']) ||
isset($_GET['p']))
&& !preg_match('/autosave/', $serendipity['uriArguments'][1]) ) {
Think i have. I just didnt want to change it on my own because Garvin said he wants to look into that.
Re: Entry disappeared after editing
Posted: Mon Dec 12, 2011 3:13 pm
by garvinhicking
Hi!
Please go ahead and commit, I think this should work
Regards,
Garvin