HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

"Quick Reply" provides incorrect links in preview

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#57351 (In Topic #12468)
Avatar

Fan in action

I recently noticed that using the "post" comcode tag within the "Quick Reply" block on my forum has some interesting results. When I use the preview function, the URL the link points to is:

http :// www.mysite.com/topicview/findpost/51.htm#post_51

This link hits a 404 page, because the correct link is:

http :// www.mysite.com/forum/topicview/findpost/51.htm#post_51

If I preview the "post" comcode tag in the full editor, it resolves to the correct link. If I make the post, the tag resolves to the correct link, whether I make said post via the full editor or via "Quick Reply". It's only in the preview for the "Quick Reply" that there's an issue. I'm going to look into this a bit myself, but I figured the experts might have a better clue :). For reference I am running version 4.2.2.

Additionally, is there a formal place to submit bug reports and patches? I've done a bunch of small patches and functionality changes that I'd like to contribute to the community.
Back to the top
 
Posted
Rating:
#57352
Avatar

ocStaff (admin)

Hi,

Please post any patches and changes in this developing forum. There's a bug reports forum under deploying, but it's not a big deal – I tend to check everywhere and handle things as they come in.
We'd really welcome your patches. There's a pinned topic here discussing whether you would want to transfer copyright on changes or not. For new code we'd need that if it was to be integrated to ocPortal, but if you're not comfortable with that it's fine just to put it out as an addon.

I'm glad you reported this bug. We've had some automated error mails (about broken links) about this in the past, and I always assumed they were generating by bots as I couldn't reproduce. Now it makes sense.
The preview script runs as the page it is previewing for, and in this case, that is 'topicview' – because the link is also to 'topicview' it discerns that the zone for the link must be the current one (this is implemented so that if transparent redirects are set up for modules, it will maintain the choice of zone as you browse through that module).
The preview script however is not truly the 'topicview' page and it's actually zone is reported as '', hence the broken link.

The fix is to change:

Code

   if (($module_name==get_page_name()) && ($module_name!='login'))
to:

Code

   if (($module_name==get_page_name()) && (running_script('index')) && ($module_name!='login'))
in sources/zones.php.

That will make the 'cleverness' only apply when actually running from inside a real zone (which the 'index' script always serves).



Become a fan of ocPortal on Facebook or add me as a friend.

Expand: Was I helpful? Was I helpful?

Expand: Follow me on Twitter Follow me on Twitter







If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource.
Back to the top
 
Posted
Rating:
#57391
Avatar

Fan in action

Hey Chris,

That fix worked great, thanks for running the issue down so quickly!  I've already posted one of the patches I worked on in 4.2.2, and I can put up some more - at this point what I've done is all patches or tweaks, so I have no problem giving them up to the community freely.  I won't worry about rights or whatnot until I build more complex modules :).
Back to the top
 
Posted
Rating:
#57392
Avatar

ocStaff (admin)

Hi,

Thanks, I appreciate this :). If you could get them up within the next day there's a chance they'll make 4.3 RC3 :).



Become a fan of ocPortal on Facebook or add me as a friend.

Expand: Was I helpful? Was I helpful?

Expand: Follow me on Twitter Follow me on Twitter







If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: