Badly formed URL when searching forum posts
| Project: | UIE Forum |
| Version: | 5.x-1.x-dev |
| Component: | Search |
| Category: | bug report |
| Priority: | normal |
| Assigned: | zoro |
| Status: | closed |
Jump to:
This one comes when searching through forum posts. It correctly finds posts, but the URLs created for them are not created correctly.
For example, I have a forum topic with "This is a test" as a title at "http://www.example.com/forum?c=showthread&ThreadID=19"
When using the search function to look for test, it does find the topic, but the link to the post is set at "http://www.mediasnobs.com/uieforum%2526c%3Dshowthread%2526ThreadID%3D19"
I narrowed it down to uieforum.module on line 1847 where it shows:
$find[] = array('link' => url(uieforum_get_module_menu_name() ."&c=showthread&ThreadID=".$row->ThreadID),
I am unable to fix this at all, as it seems drupal tries to clean up the following characters: '&', '=', and even '?'.
Looks like the slash ('/') is not cleaned up in this matter. It might be best at this point to move to clean URLs for the forums to get the search to work.

#1
Oh, by "clean" URLs, I mean that the threads can be accessed via http://www.example.com/forum/c/showthread/ThreadID/19 instead.
#2
Yeah I was thinking of rewriting the module to work like that, but to be completely honest, even though it's clean, I don't like it :(
I'll look into it again though
#3
Yay! I figured out a workaround if you have the rewrite module working in apache. In my .htaccess file in the drupal root directory, I added the following before the "# Rewrite current-style URLs of the form 'index.php?q=x'." line:
#RewriteRule to let the search engine point to a post correctlyRewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^uieforum/forumthread/(.+) uieforum?c=showthread&ThreadID=$1 [nc]
In modules/uieforum/uieforum.module, I modified line 1847 to show:
$find[] = array('link' => url(uieforum_get_module_menu_name() ."/forumthread/".$row->ThreadID),Now the uieforum search will work, but the forum URL will work as normal (outside of the search paths).
#4
Hi there - could you confirm that this works as you described? I get all resulting links in the format /forum/forumthread/4 as the URL. When I click these I always end up at the Forum root (i.e. it shows the different forums, not the actual message thread). The UIE forum does not understand /forumthread/ ... I have clean url's on for the rest of the site.
Howcome this works for you? Confused :)
Thanks for your feedback!
bye,
Harro
#5
Okay! sorry for the page-soiling - found the cause and it works like a charm now:
the UIE forum on my site is not on /uieforum/ but on /forum/, so my code in .htaccess becomes:
RewriteRule ^forum/forumthread/(.+) forum?c=showthread&ThreadID=$1 [nc]Just for the record, in case someone else has modified their UIE forum url.
#6
Nice addition - it may end up being an incredibly useful workaround for this module.
But there could be problems with it when it comes to replying/quoting/editing ... etc.
I'll look into it though.
#7
I had the same problem with v5. Thanks nickistre, your workaround does work again!
#8
I've fixed the shoddy php code causing this error - it was caused by bad code that got migrated from the 4.6 version and has stuck there until now!
Thanks again guys,
Daniel
#9
Hi,
I noticed there is some bug in the URLs when the admin is deleting a post. The deletion goes well, but after the deletion the user gets redirected to a "Page not found" because of mis-formatted URL.
This is the URL before the deletion (seems to have some 'q' in it, might have to do with clean URLs?)
http://www.thetaconnections.net/admin/content/uieforum/edit/post/27?dest...
This is the URL after the deletion, which shows 'Page not found'
http://www.thetaconnections.net/q%3Duieforum
Cheers, Val
#10
Not anything to do with searching though, is it? :)
This is a known bug - I haven't bothered fixing it yet, as the admin stuff still works, it just doesn't redirect you correctly.
I definitely know about it :) Thanks!
#11
#12