Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-22 18:25:05

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Commenting not working properly - URL is broken

Hi folks,

I just installed this morning and finally got things working properly, after some issues with PHP and MySQL.

Now that I have Textpattern up and running, the first issue I’ve come across is that commenting is not working properly.

When I fill out a comment and hit “preview” it loads a URL like such:

/blog/id=2#cpreview

This brings me to a 405 error page (I’m using IIS as the server)

If I manually put in the page name

/blog/index.php?id=2#cpreview

the page loads fine. Where in TP can I fix this?

Thanks!

Offline

#2 2005-12-23 14:43:42

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

So I’m not sure if this is really a hard problem, or just doesn’t happen on servers other than IIS and no one uses IIS, but I’m pretty surprised that no one has a fix for it?

It pretty much renders TextPattern unusable if you want comments. I’ve looked through the database and don’t see any places where this would be changed.

Offline

#3 2005-12-23 20:35:47

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Commenting not working properly - URL is broken

Maybe zem is right

I’m sorry I don’t know about IIS, but have you tried searching the forum with Google?

Offline

#4 2005-12-27 15:37:46

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

doggiez,

thanks for the reply at least. Perhaps zem is right.

I did search through the archives but didn’t find anything, most IIS related issues seem to be related to the “nice URLs” – I’m really not even sure if it’s an IIS issue or not, as I’m not familiar with how the behavior of an Apache server would work. If Apache just automatically assumes the default document after the / then I could see why it would work properly.

But even if someone can tell me how to get into the system to manually add the page name, that would work as well.

Thanks.

Offline

#5 2005-12-27 17:56:05

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Commenting not working properly - URL is broken

As far as I can see hitting the preview button just adds #cpreview after the current url. Is /blog/id=2 a working url for you? It does seem odd. What is your permanent link mode?

Offline

#6 2005-12-27 19:35:59

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

The problem occurs after you fill out the comment form, and hit “preview”

If you look at the form action for the comment form:

<code>
<form method=“post” action=“id=2#cpreview” id=“txpCommentInputForm”>
</code>

the action is simply “id=2#cpreview”

so, on my machine at least, it’s going back to the root of the folder…so when my address is:

http://server/blog/index.php?id=2#comment

after I hit preview it becomes:

http://server/blog/id=2#cpreview

somehow i need to insert the actual page name (index.php or dynamically would be best i guess in case it changes) into the form action. but i’m not sure where i can find that in order to edit it.

>>Is /blog/id=2 a working url for you?

No – because there is no page name. Not sure if on Apache is automatically uses the default document when there is no page name specified but IIS does not seem to.

not sure about my link mode, i can’t get back into the admin site — it seems i have forgotten my password and don’t know how to reset it. :-)

Last edited by bruno1378 (2005-12-27 22:22:49)

Offline

#7 2005-12-27 19:41:57

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

ah ok i was using the wrong login name – which i figured out after i reset my password. :-)

Permament link mode is messy.

Offline

#8 2005-12-27 21:17:50

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Commenting not working properly - URL is broken

I can only tell you what I see when I hit preview on my local site, which is in messy mode. The url of the original page is domain.com/index.php?id=113, and the preview code is <form method="post" action="/index.php?id=113#cpreview" id="txpCommentInputForm">. And I don’t know why yours is different.

If /blog/ is your root, the Site URL in Preferences should be domain.com/blog. Maybe there is something wrong there?

Offline

#9 2005-12-27 22:21:55

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

Interesting- that’s what I want mine to look like!

It’s a fresh install, so I haven’t changed anything…

under site prefs > publish the site URL is “server/blog” so that looks ok….comment mode is in nopopup, though i tried popup and it didn’t work either.

(just a note – i have tested textpattern, wordpress, and nucleus – wordpress gave me tons of db errors, and nucleus got up and running with no issues whatsoever. but it looks like textpattern has more builtin prefs to manage it and looks like the templates might be easier to update as well. although i don’t really like the textile for comments)

Offline

#10 2005-12-27 22:35:14

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

Ok

So I messed around some more and found the file blog/textpattern/publish/comment.php where there is a function commentForm.

In commentForm, it builds that form action.

<code>
$out = ‘<form method=“post” action=”’.$url.’#cpreview” id=“txpCommentInputForm”>’;
</code>

Ok…so it looks like for me, that the variable $.url is not set to anything.

I’m not sure exactly where that comes from….the only thing I see is right above that bit of code it says this:

<code>
// Experimental clean urls with only 404-error-document on apache
// possibly requires messy urls for POST requests.
if (defined(‘PARTLY_MESSY’) and (PARTLY_MESSY)) $url = hu.’?id=’.intval($parentid);
</code>

but i’m not sure what that does? what is $url equal to if it passes over that IF statement?

Offline

#11 2005-12-27 22:45:51

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Commenting not working properly - URL is broken

>>Is /blog/id=2 a working url for you?

No – because there is no page name. Not sure if on Apache is automatically uses the default document when there is no page name specified but IIS does not seem to.

IIS is probably looking for an index.html file in /blog/; not finding one, it returns a 404. Is there a way you can add index.php to the list of possible default documents? In Apache that’s done with the <code>DirectoryIndex index.php</code> directive in .htaccess, hopefully there’s something similar for IIS.

-Kurt

Last edited by KurtRaschke (2005-12-27 22:46:22)


kurt@kurtraschke.com

Offline

#12 2005-12-28 01:20:43

bruno1378
Member
Registered: 2005-12-22
Posts: 22

Re: Commenting not working properly - URL is broken

Hi Kurt,

I did think about the default document and did add index.php, but it made no difference. If you read my last post the problem seems to be coming from the fact that the $url variable in comments.php doesn’t seem to be set to anything. But I’m not sure where that is being set?

Thanks.

Offline

Board footer

Powered by FluxBB