The Problem

If you are using my Help Desk Plugin or my Terms Of Use Plugin with WordPress MU 2.7 you will notes there is an error with the sub menus.

There is a small bug in WPMU 2.7 menu-header.php. The problem is that the link that’s generated for the submenu is not of the form admin.php?page=submenu.php, but instead, it’s of the form toplevelmenu.php?page=submenu.php

The Simple Fix

In menu-header.php on line 122
[scrolldiv]

$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]) || ( file_exists( WPMU_PLUGIN_DIR . "/{$item[2]}" ) && ! is_dir( WPMU_PLUGIN_DIR . "/{$item[2]}" ) );

[/scrolldiv]
should be:
[scrolldiv]

$parent_exists = !$admin_is_parent && ((file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]) || ( file_exists( WPMU_PLUGIN_DIR . "/{$item[2]}" ) && ! is_dir( WPMU_PLUGIN_DIR . "/{$item[2]}" ) ));

[/scrolldiv]
Note the different grouping of conditions, hopeful this problem will be resolved in 2.7.1.

22 Comments

  1. ovizii says: February 23, 2009 at 4:34 pm

    thx, that solved the problem for now

  2. Wordpress Help Desk says: February 23, 2009 at 11:22 pm

    [...] If you are using WPMU 2.7 there is a bug with the menu-header.php, apply the WordPress MU 2.7 Sub Menu fix. [...]

  3. Petester says: February 24, 2009 at 7:59 am

    Hmm, it seems that your code has been HTML’d… && became &&. You might want to make a note about that.

  4. Levi Putna says: February 24, 2009 at 8:30 am

    Thanks Prtester, problem solved, the code should now be cut and past.

  5. Beau Lebens says: February 24, 2009 at 2:59 pm

    Thank You! I’ve been wrestling with this problem on a plugin i’m trying to use for an hour now, and you just solved my problem.

    Has this been submitted to trac for WPMU so that it’ll get fixed? It’s definitely a legitimate bug.

    Cheers,
    Beau

  6. Levi Putna says: February 25, 2009 at 12:46 pm

    Yes a ticket has been submitted http://trac.mu.wordpress.org/ticket/913

    I don’t know if this is a bug or some new WP 2.7 menu feature. All I know is this hack helped with some backwards compatibility issues.

  7. Michael Specht says: March 8, 2009 at 2:09 pm

    Thank you so much! I have spent about 4 hours trying to work out what the issue was with my plugin.

  8. ovizii says: March 10, 2009 at 8:14 pm

    k, another small problem.

    I clicked on an existing entry in the knowledgebase and the popup gives a 500 server error, but I guess its related to the path again. the url of the popup is: http://zice.ro/wp-content/plugins/help-desk/popup.php?kid=1

  9. Levi Putna says: March 12, 2009 at 1:57 pm

    Problem fixed in WPMU 2.7.1 if you want to test it.

  10. ovizii says: March 12, 2009 at 7:52 pm

    any simple patch/hotfix available? Otherwise I’ll just wait for 2.7.1

  11. Levi Putna says: March 12, 2009 at 9:10 pm

    No patch, all you need to do is copy past the one line of code above into menu-header.php. couldn’t be simpler.

  12. ovizii says: March 12, 2009 at 11:43 pm

    there seems to be a misunderstanding. I already applied that patch, all menus work fine now BUT when I click on an entry in the knowledge base to read it, the javascript that pops up gives a 500 server error and the path links to: http://zice.ro/wp-content/plugins/help-desk/popup.php?kid=1 which is obviously wrong, right?

  13. Levi Putna says: March 13, 2009 at 12:01 am

    Hi ovizii,

    Sorry I didn’t realize you were talking about the Help Desk plugin, what version of Help Desk are you using?

    RC1 removes the knowledge and just gets the basics working. I am running it without any issues.

    Give it a try and let me know.

  14. ovizii says: March 13, 2009 at 4:40 pm

    k, now I have the RC1 was running the beta still. btw. why remove the knowledge base?

  15. worldblogosphere says: March 13, 2009 at 7:16 pm

    Hi,

    I am trying and trying to get this plugin to work. I have read through all the strings of comments and followed things so far. I upgraded to 2.7.1 already, but I am still getting the “Cannot load terms-and-conditions/terms-and-conditions.php.” error.
    From the start i was unsure if I was following the installation instructions properly. You did mean the following right?
    The program unzips into terms-and-conditions-02-beta folder that contains a terms-and-conditions folder (this folder contains an htacces file, the three text files, and ANOTHER terms-and-conidtions.php file), a read me, a license, and a terms-and-conditions.php file.
    I need to take that t-and-c folder, and the first .php file and put them bot in mu-plugins? Not the second .php file?
    Plus as I said first, that line of code is correct in the 2.7.1 upgrade and I am still getting the same error. What else could it be?

    Thanks for any assistance,
    Gene :-)

    • Levi Putna says: March 18, 2009 at 10:46 am

      Hi worldblogosphere,

      Try putting the terms-and-conditions folder in the plugins folder not the mu-plugins folder leave the terms-and-conditions.php in the mu-plugins folder.

      This should work with WPMU 2.7.1, let me know how you go and I will change my instruction.

  16. Cruelty says: March 19, 2009 at 10:14 pm

    Hey there,

    I have problem:
    Warning: Division by zero in [...]/wp-content/mu-plugins/help-desk/pages/tickets.php on line 39

    And if a User sets up a ticket, the Script says an admin will reply soon, but there is no ticket delivered.

    Using WordPress MU 2.7.1 and did the Sub Menu fix.

    I hope you can help

    Best regards from Hamburg, Germany

    Cruelty

  17. Cruelty says: March 19, 2009 at 10:25 pm

    Solved the Problem by Myself…

    There was no value at “Page Size”… Now the only Problem is the sentence: Ticket are re-opened whenever user adds a new message, ticket closed by admin only.

    It stands there twice. Once at the right please next to the Readiobutton and once under the Page Size-Option. But yeah, I guess that’s not really a problem as I just can see it in the settings as an admin. ;)

    I really thank your for this great script and Hope you will release it soon. :)

    Thank for the attention. :)

  18. ovizii says: March 20, 2009 at 5:48 pm

    well, same problem here: I can access the ticket from the link in the email I received but I can’t browse to it via the plugins interface :-( the plugins menu doesn’t lsit any tickest :-(

  19. judi says: November 24, 2009 at 5:57 am

    Wow thanks for this great plugin, its so simple, much nicer than advanced ticket system :) also I love your site background.

    I’m getting an error in the helpdesk admin ‘Warning:Division by zero /home/ artygirl……………..helpdesk/pages/tickets.php on line 39′.
    Is there any way to get rid of this and what does it mean?

    Thanks again
    Judi

  20. judi says: November 24, 2009 at 6:02 am

    I can’t see any my tickets I’ve posted

Leave a Reply

Your email address will not be published.

*