The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Bugs Entry disappeared after editing

Found a bug? Tell us!!
User avatar
onli
Regular
 
Posts: 1044
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Sat Nov 13, 2010 4:04 pm

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?

User avatar
Timbalu
Regular
 
Posts: 2542
Joined: Sun May 02, 2004 3:04 pm

Postby Timbalu » Sat Nov 13, 2010 4:40 pm

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----

User avatar
onli
Regular
 
Posts: 1044
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Sat Nov 13, 2010 5:59 pm

Danke. Darauf wär ich nie gekommen.

It seems like not the edit is responsible but the number in the title is.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Sun Nov 14, 2010 12:34 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
onli
Regular
 
Posts: 1044
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Sun Nov 14, 2010 1:36 pm

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:
Code: Select all
/100-testeintrag.html

and matches[1]:
Code: Select all
100

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?

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Nov 15, 2010 1:07 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
onli
Regular
 
Posts: 1044
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Thu Mar 17, 2011 12:10 pm

*remind* ;)

User avatar
onli
Regular
 
Posts: 1044
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Sat Dec 10, 2011 2:21 pm

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?

User avatar
Timbalu
Regular
 
Posts: 2542
Joined: Sun May 02, 2004 3:04 pm

Postby Timbalu » Sat Dec 10, 2011 3:17 pm

Hi Malte

You have GIT access haven't you?
If not, tell me what to change.
Regards,
Ian

User avatar
onli
Regular
 
Posts: 1044
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Sat Dec 10, 2011 4:19 pm

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.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Dec 12, 2011 4:13 pm

Hi!

Please go ahead and commit, I think this should work :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/



Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests