Menu problems when using Joomfish and K2

Today was a pretty uneventful – some might even say boring – day until I noticed a SERIOUS problem with the website I’m working on.

Here’s the situation.  For a project, I’m using Joomla!, K2 and Joomfish.  Most of the site was built around the K2 component; and I use Joomfish for the translations.  The last component proved to be a pain in the ass.

The problem?  When using the “translated” version of my site, Joomfish had butchered my menu items.  Everything worked fine where I link to a single K2 item – which is why it took so long for me to spot the problem.  But when I visited one of the “Category pages”, I was shown a lot of information that shouldn’t be there.  All K2 items were thrown together on one page, instead of showing only the items of the selected category.

Now what?  I tried to analyze the problem -> Joomfish did something to my menu’s, and I assumed it had to do with K2.  I was correct!

Solution

If, like me, you’re using a combination of K2 and Joomfish, and your menu starts to behave strangely, the fix is simple.  Chucknology posted a solution on the K2 community forums.

The problem lies with Joomfish and how it “translated” menu links.  When K2 comes into play, things can go wrong. Who’s fault is that?  I don’t know.  Alle I know is that Chucknology came up with a solution that works.

What you’ve got to do, is this:

  1. Download C’s customized menu.xml file.  For your convenience, I’ve uploaded it to my Skydrive.
  2. FTP to your site:  administrator > Components > com_joomfish > contentelements
  3. Overwrite the file menu.xml with the one you just downloaded.  My advice is to rename the “old” file first, to something like notworking_menu.xml

That’s not all.  Now, head back to your Joomla! site and go to the “translated” menu items.  Scroll way down to the bottom, where you’re asked to translate the link.  Click ‘copy’ and then click ‘save’.  Repeat for every menu item that’s been misbehaving.

Credit goes to Chucknology (whatever his real name is) for coming up with the fix.  I am merely a messenger.

41 thoughts on “Menu problems when using Joomfish and K2”

  1. Thank you very much Chucknology and Steven for posting this solution!

    I must say that this fix worked perfectly for me too!!!

  2. Pingback: All Around the World News

  3. Lesley Parker

    Thank you for posting this. I didn’t find it in the K2 forum, so you got me there. And thanks for the clear instructions.

    1. I believe that the forum was my ‘source’ for this solution. But the forum’s not very “search” friendly so I’m glad I could help you. 🙂

  4. Thanks. While I was developing the official website from my organization I run into the same problem. Your xml fixed the issue. I see it only was a problem with category list view. It would be helpful if Alex from K2 made a official entry on the site to submit solutions like yours, instead of searching for hours on their forum. Thanks again.

    1. Martin,

      Glad to see this worked for you!

      Like I said in the post: the xml fix isn’t really ‘my’ solution. Can’t take any credit there! I found it on a forum (K2’s forum perhaps?) but it took me so long to find that I decided to put it on my blog.

      And voila… people who don’t find the solution on the forum find it here. My job is done 🙂

  5. Hi,
    i need very urgently of file.. but is no longer available 🙁
    could someone post it? thxxxxxx

    I have version 1.5.15 of Joomla, Joom! Fish Version v2.0.4, K2 v2.0

    1. Fabry,

      The file is still available on the location I posted.

      I’ve taken the liberty to mail it to you, as well, assuming you check the e-mail adress you used to post this reply 😉

  6. Hello, THANNKKKKKKK!!!!! IT’s work for me, I had the same problem, only change in menu.xml the line field type=”readonlytext” name=”link” translate=”1″ posthandler=”saveUrlParams” prehandler=”checkUrlType”….. and replace with field type=”text” name=”link” translate=”1″ posthandler=”saveUrlParams” prehandler=”checkUrlType” …. . that its all. thank Chucknology

  7. Pingback: One year anniversary « Joomla and more

  8. Warning: DOMDocument::load() [domdocument.load]: Entity ‘nbsp’ not defined in /home***/administrator/components/com_joomfish/contentelements/menu.xml, line: 247 in /home/***/administrator/components/com_joomfish/classes/JoomfishManager.class.php on line 185

    What could be the problem? I added this xml…

  9. Thank you so much ! I was going desperate trying to figure out what the problem was. I was about to give up but then you came along in my google search. Cudos both to you and Chucknology !

  10. Perfect, thanks for documenting this. I think I have about 4 sites coming up with k2 and joomfish, I’ll need this for all of them. Simple fix that works perfectly.

  11. It work perfectly.
    But a can’t find how to translate K2 Items. When I’m in K2 area cannot display “translate to:”

    What I must to do?

  12. Thanksssssssssssssss a Lot….. I was about to loose a project for this. you made it…. God Blessss youuuu… 🙂

  13. trapecistadesignhouse

    Really helpful post. I also noticed that sometimes when one translates a menu item using joomfish it mess up the parameters (basics) -leading, intro, columns and links- from language to language. I had to adjust’em manually. [perhaps it happened to me because I am working on an english-chinese site, where chinese language seems to be particularly buggy-

    Cheers!.

  14. Achim Dimmler

    So simple! Many thanks for this solution. It saved me from a big headache!

  15. hi
    its long time since i worked on old joomla 1.5, but that is what my customer have.
    i have to say your fix worked perfectly for me!!!
    i will keep your site url in my favorites.

    thanks allot and all the best for you guys.

    1. Great to see the article was useful! To be honest, I had to apply this trick myself a week or two ago, on a J! site we can’t update yet.

  16. I came across this problem just now…
    The cause seems to be the existence of two hidden html form input fields titled “task” and “id”. The menu url is a read-only text (god knows why?), and the menu.xml specifies that these should have the “saveUrlParams” function run on them (in models -> ContentObject.php). The problem is, that this function takes the menu url text you’ve put in, and checks every separate parameter in it versus any matching form input fields. If there are any, it will rewrite their value to those in the form input.

    that’s why something like
    index.php?option=com_k2&view=itemlist&layout=category&task=category&id=1
    gets replaced with
    index.php?option=com_k2&view=itemlist&layout=category&task=&id=
    resulting in completely broken translated pages.

    Your fix sets these links to NOT run the saveUrlParams function. I’m not sure if that is the perfectly correct thing to do, it looks like it does some kind of url sanitization. I’m not sure.

    But, your solution works – I’m just wondering if not pulling this function has any ill effects. It has to be there for some reason…

Comments are closed.

Discover more from PowerUser Guide

Subscribe now to keep reading and get access to the full archive.

Continue reading