We recently developed a site where we are using the excellent Joomla component Mosets Tree (version 2.0.2). To generate SEF URLs for the site, we are using the sh404SEF component as JoomSEF doesn’t play as nice out of the box.
However, when using sh404SEF there are a couple of issues, most noticeably the fact that status alerts (such as the “Listing submitted successfully! or “Your review is pending approval.” messages that appear when the user submits/rates/reviews/etc. something in the directory) do not appear. This is obviously bad for the user as they don’t get any feedback on whatever action they have just performed.
Luckily, there is a way to fix this that’s not too complicated …
We will need to edit the following file:
/components/com_mtree/mtree.php
Once you have this file open, search (ctrl+f) for “mosRedirect” (without quotes). What we are looking for are lines of the following type:
mosRedirect( "index.php?option=$option&task=viewlink&link_id=$link_id&Itemid=$Itemid", $_MT_LANG->REPORT_HAVE_BEEN_SENT);
These lines basically tell the browser to redirect to a specific page after performing a task (for example, when a user submits a review of a listing), and also to append a user message to the URL which will be displayed.
To get these working as they should be, we need to add the function
sefRelToAbs()
to the URLs, which we do like so:
mosRedirect( sefRelToAbs(“index.php?option=$option&task=viewlink&link_id=$link_id&Itemid=$Itemid”), $_MT_LANG->REPORT_HAVE_BEEN_SENT);
Note that we only enclose the URL within the function and not the appended message or any other arguments that might be present.
Continue to go through the file adding this function to all similar lines (there are about a dozen or so if I remember correctly), then save and upload it.
The user messages should now be working (you may need to purge any SEF URLs that have already been generated)!
I haven’t checked if this is happening on my site, but I am also using Mosets Tree with sh404SEF, however, I’ve had it turned off while under development. Previously (when I had it on) I had run into a problem with sh404 and the M Tree search module, which did not resolve the SEF url correctly and would 404. The culprit are some lines in the mod_mt_search.php file that try to create the SEF url with Javascript what I feel is an inappropriate application for such a situation. The way to fix it is to comment out the entire section labeled “# Using Built in SEF feature in Joomla” all the way down to “# Using SEF advance or no SEF at all,” which is the section to leave in as it allows the right link to be created.
BTW, thanks for the tip, I’m sure I’m going to need it though I haven’t discovered the problem yet.
Comment by Eric — Aug 10 2008 @ 3:21 pm
http://www.message_oloalrol.com/
Comment by nick_reltro — Apr 10 2009 @ 3:54 pm
Tried this and works exept for advanced search (mod_mtree_search) doesn’t retrun searchresult anymore. Suggestions? Am I doing something wrong? Thanks!
Comment by Michel — May 5 2009 @ 2:41 pm
thanks for the information the information provided by you is so useful and very informative.
Comment by Hire Dedicated C# developers — May 20 2010 @ 8:22 am
I am happy to read your informative post.
Comment by Buy Software — Jun 9 2010 @ 2:14 pm