geniouses of drupal please help
im new to dupal and i think i just read all the threads ever opened about it
ive been trying to theme the commenting system completely. take it out of the $content and theming the comment form as well.
the problem i seem to be having has to do with the drupals behaviour after hitting 'post comment' submit button:
drupal adds a comment [ex. cid = 23] to a node [ex. nid = 2] and then navigates to q=node/2#comment-23. the thing is is that instead of seeing the actual node [#2] at that location, drupal presents a list of nodes. more confusing even is that when at that point i refresh the browser, node#2 IS presented as i thought was supposed to in the first place.
is this the normal behaviour ? doesnt this seem inconsistant ? if this so what is the point of sending drupal to anchor #comment-23 - the comment list isnt even present anyway.
is this a bug ? is there a way to skip that node list display and after posting a comment go directly back to displaying the node the new comment has been added to ?
By baec on
Comments
update : i just tried it on
update :
i just tried it on firefox and posting comments does return to node view. so this means its either some faulty behaviour on IE or that my IE is screwed up in some way ?
can anyone verify this behaviour of drupal on IE ?
create new PAGE content type > add new comment > enter comment info > press post comment > does drupal show you now a nodes list ? or that single node you just added a comment to + its list of comments attached to it ?
anyone ?
another update :
ruled out the possibilty this is merely a psychotic episode im having by testing this issue on a different machine and with DRUPAL 4.7 as well. both 4.6 and 4.7 seem to have this BUG [after posting a comment drupal returns to a node list and not to viewing the node the comment was added to, but still shows the address q=node/(nodeNumber)#comment-(newCommentNumber)].
furthermore i have just installed internet explorer 7 and tested it. it seems IE7 doesnt have this BUG.
but that doesnt help much since IE7 isnt officialy out yet. i cant believe such an obvious problem can exist on the IE6 [which right now is the most important platform on the market].
havnt been getting lots of replies on this issue. i guess replies are about to start pouring in :). i must say i really regret choosing drupal. getting no support whatsoever / buggy / and messy docs. come on ! do you devs realize you have some reponsibilty towards ppl ? ive just spent more than 2 weeks studying your system. what i ask is simple enough -
can someone please confirm this simple behaviour :
with drupal 4.6 or 4.7 on internet explorer 6 > create new PAGE content type > add new comment > enter comment info > press post comment > does drupal show you now a nodes list or do a single node view + its list of comments ?
please someone who used drupal before, check it on your system. if this is really a bug i might find a way to bypass it and not lose all this time ive invested in drupal already
thx
Workaround for Comment posting with IE
Hi,
I am a drupal newby and have only been playing with it over the weekend. I am struggling to decide if it can do what I want without completely re-working most of the modules. Anyway, I digress ....
I noticed your problem today and can confirm its an IE thing. Firefox works perfectly fine in my install. I also noticed that the problem is not localised to the presentation of comments. With auto-path enabled, it gave me 'page not found' rather than the strange list behaviour when adding a comment. The URL requested looked perfectly fine, so it must be the interpretation of bookmarked links within drupal. I expect that IE and firefox are actually submitting differnt url requests when being redirected after the form post. Normal browser command line requests work fine as you saw with your refresh.
For my needs, I wasn't really bothered about reloading the node with the comment placed selected through the use of the bookmark. So, I decided to strip out that functionality and therefore get rid of the problem rather than try and workaround or diagnose further.
I tweeked the comment_form_submit function in the comments.module file to remove the bookmark include.
function comment_form_submit($form_id, $form_values) {
$form_values = _comment_form_submit($form_values);
if ($cid = comment_save($form_values)) {
// return array('node/'. $form_values['nid'], NULL, "comment-$cid");
return array('node/'. $form_values['nid'], NULL, NULL);
}
}
The original line is commented out as you can see.
This got rid of all my problems, and apart from not taking you back down to the comment that had just been posted, it was fine for my needs.
Hope that this helps a little.
I am happy to offer advise to core team or the comments module developer on how to diagnose exactly where the problem lies, but don't fancy digging through drupal at that level to work it out on my own. Especially as I may not be using drupal going forward.
Simon
Sorta solved
yo simon thx so much, needed that confirmation to make sure im not wasting my time digging deeper into drupal. for me that comment behaviour is critical though
so anyway and to anyone out there interested i have some further info on the issue-
it seems IE6 does have some trouble handling drupals URL redirection. look in includes/common.inc for
as is commented that header('Location: '. $url) seems to go wrong. having changed it with the following-
seems to fix my problem. im dont think this is the perfect solution and i would be happy to get more info about this issue but being on a tight deadline and having wasted enough time on this issue, i have to move along.
hope this helps someone
oh
oh the coin just dropped on what youve suggested and it might work for me as well since focusing on the recently added comment isnt that important to me as well. i havnt tested it yet but i will later on tonight and post my conclusions. so - another thx.
an unbased suspicion i had is that the usage of the char # in the url header LOCATION might have caused the problem by being misinterperted in IE6. your solution, completely removing the anchor call #comment-$cid, might support that suspicion. but thats just a shot in the dark, im not that great in php
What the problem actually is ( and how it needs to be fixed )
The problem is as follows :
When you enter a URL into the address bar in IE, it processes the request and generates a GET request to the target webserver with the # bookmark removed. The same processing is performed when you click a link containing a bookmark in the URL.
The problem comes when a redirect is received containing the same #Bookmark URL. In this case, IE simply submits a get request without processing the contents of the URL in the same way. So instead of a GET request containing only the URI, you get the # included as a bonus. This is what throws drupal.
To validate my assumption I knocked up a couple of PHP pages to send a redirect with the #bookmark included in the URL to the browser and the redirect target script to dump out the URI to the screen.
When tested with IE 6, the results were as described. When tested with firefox, the URI rendered on the webpage had no #Bookmark included.
This is why the path module falls apart and the comments don't work quite as expected.
Solution to all impacts in drupal ...
The real workaround may well be in the URL processing of drupal. If it was tweeked to strip off the # values in any URLs actually submitted, it would all work across browsers correctly.
As an aside, when I launched my redirect script using CURL and asked it to follow the redirect, the target script rendered the URI with the #Bookmark included as well. This makes me wonder if the spec is clear about how this should be handled.
Anyway - not sure how easy it would be to sort the above out in PHP/Drupal, but I'm sticking with my redirect without the bookmark. I understand you opted for a javascript redirect instead, but if they don't have JS enabled, then thier dead and stuck in some strange blank webspace.
Simon.
well i dont know much about
well i dont know much about CURL but that point youve mentioned about JS is certainly a good one. i just want to note for any possible future readers of this post [and i expect loads of them to start dropping in any second now], that the solution youve presented removing the bookmark part of the URL works for the 4.7 version of drupal.
though
come to think of it if the client doesnt have JS enabled a couple of other things in drupal 4.7 aint gonna work
fix
I'm a drupal newbie so I'm sure my fix will appear hackish and that someone will want to clean it up or move it to somplace more appropriate. Until then, this works:
in index.php just before $return = menu_execute_active_handler();
add:
if ($hashpos = strpos($_GET['q'], '#')) $_GET['q'] = substr($_GET['q'], 0, $hashpos);