The MU forums have moved to WordPress.org

problems with the helpdesk plugin (19 posts)

  1. Ovidiu
    Member
    Posted 13 years ago #

    talking about this plugin: http://ozblog.com.au/2008/08/20/29

    the menu is broken with wpmu 2.7.found this code:

    // Add a new top-level menu
        add_menu_page('Help Desk', 'Help Desk' . $alert, 0, __FILE__, 'help_desk_core');
    
        // Add a submenu to the top-level menu:
        add_submenu_page(__FILE__, 'New Ticket', 'New Ticket', 0, 'help-desk-new-ticket', 'help_desk_core');
    
        // Add a submenu to the top-level menu:
        add_submenu_page(__FILE__, 'Knowledgebaset', 'Knowledgebase', 0, 'help-desk-knowledgebase', 'help_desk_core');
    
    	if(is_site_admin()){
    		// Add a submenu to the top-level menu:
        	add_submenu_page(__FILE__, 'Settings', 'Settings', 0, 'help-desk-settings', 'help_desk_core');
    	}
    }

    The top level menue is ok, but the sub-menus are broken. can someone help fix this?

    all sub menu links, link to /wp-admin/help-desk.php?page=help-desk.php while they should link to /wp-admin/admin.php?page=help-desk.php

    ###edit###
    found several old posts, but no solution?
    i.e. http://mu.wordpress.org/forums/topic.php?id=2587

  2. levi.putna
    Member
    Posted 13 years ago #

    Hi Ovidiu,

    I'm the plugin developer, I don't have much spare time this week but ill have a look and post a new version with the 2.7 fix to the plugin homepage (http://ozblog.com.au/2008/08/20/29) this weekend.

  3. Ovidiu
    Member
    Posted 13 years ago #

    thx a lot :-)

  4. kuene
    Member
    Posted 13 years ago #

    there is also an MYSQL Error that appears in my apache-error-log!

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '== 'Open'' at line 1 for query SELECT COUNT(id) FROM wp_help_desk WHERE status == 'Open' made by require_once, require, do_action, call_user_func_array, help_desk_menu

  5. Ovidiu
    Member
    Posted 13 years ago #

    I think that comes from the fact, that you haven't got any tickets yet, can you try and see if the error persists if you open a ticket?

  6. kuene
    Member
    Posted 13 years ago #

    yes the error remains.

    [Wed Feb 18 13:54:56 2009] [error] [client 172.xxx.xxx.xxx] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '== 'Open'' at line 1 for query SELECT COUNT(id) FROM wp_help_desk WHERE status == 'Open' made by require, do_action, call_user_func_array, help_desk_menu, referer: http://xxx.xxxx.xx/wp-admin/plugins.php

    i use worpress mu 2.7.
    for the helpdesk plugin to work i have made a symlink.
    ln -s wp-admin/admin.php wp-admin/help-desk.php

    but there are mysql erros.

  7. Ovidiu
    Member
    Posted 13 years ago #

    ln -s wp-admin/admin.php wp-admin/help-desk.php
    are you sure this symlink doesn't break all other plugins????

    believe me they will break ;-)

  8. kuene
    Member
    Posted 13 years ago #

    Ovidiu: belive me they will NOT brake.

    to the mysql error:

    in line 54 of help-desk.php
    the line:
    $open_tickets = $wpdb->get_var("SELECT COUNT(id) FROM $table WHERE status == 'Open'");

    should read
    $open_tickets = $wpdb->get_var("SELECT COUNT(id) FROM $table WHERE status = 'Open'");

  9. Ovidiu
    Member
    Posted 13 years ago #

    what about plugins that also use: admin.php because they have their own top-level menu?

    i.e.

    CformsII: yoururl.com/wp-admin/admin.php?page=wp-polls/polls-manager.php

    Wp-Polls: yoururl.com/wp-admin/admin.php?page=wp-polls/polls-manager.php

    won't these be broken by your proposed symlink?

  10. kuene
    Member
    Posted 13 years ago #

    no because: "man ln" ;)
    ln [OPTION]... [-T] TARGET LINK_NAME
    ln -s wp-admin/admin.php wp-admin/help-desk.php

    so in wp-admin folder the admin.php has two names:
    admin.php and help-desk.php

    it can not possibly brake anything!

  11. Ovidiu
    Member
    Posted 13 years ago #

    sory :-( my bad. really. I read it backwards, I thought you were symlinking admin.php to help-desk.php :-(

  12. levi.putna
    Member
    Posted 13 years ago #

    This problem seems to be a little more in-depth than I first thought, it appears that WPMU 2.7 will not support top level menu with several sub menus created from a plugin in wp-plugin.

    I even tried the basic top level menu example in the Wordpress documents (http://codex.wordpress.org/Adding_Administration_Menus#Inserting_the_Pages) and have the same problem as the help desk menu.

    This might be a problem with WPMU itself.

    I’m still trying to find a simple code based workaround.

    Any thoughts?

  13. levi.putna
    Member
    Posted 13 years ago #

    OK, 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

    See my website for the fix.
    http://ozblog.com.au/2009/02/23/wordpress-mu-27-sub-menu-problem/

  14. tdjcbe
    Member
    Posted 13 years ago #

    Lookie, we got a freshly made trac ticket:

    http://trac.mu.wordpress.org/ticket/913

  15. levi.putna
    Member
    Posted 13 years ago #

    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.

  16. Ovidiu
    Member
    Posted 13 years ago #

    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

  17. Ovidiu
    Member
    Posted 13 years ago #

    unfortunately I can't access/see any tickets from the back end.
    If I click the emails I am getting about new tickets, I can access them and work on them just fine.

    Any ideas?

  18. levi.putna
    Member
    Posted 13 years ago #

    Hey Ovidiu,

    Did the recent plugin update fix any issues you were having?

  19. Ovidiu
    Member
    Posted 13 years ago #

    nope, but I found out what was wrong. if you don't enter any value for "Page Size" in the settings it gives this division by zero error. Entered 10, saved, all is good now :-)

About this Topic