RT 5.0.0 [error]: Can't locate object method "child" via package "Menu"

Actually digging a bit deeper into Best Practical’s github, it looks like that if(Menu->child("new")) { is a hang over from when the menu building logic was lifted out of share/html/Elements/Tabs and put into its own module. If you look at commit 755042f6a9941734e21a987a638ff03b36b4dc18 you can see the old code with those lines towards the end of the removed code.

Now looking up a back a bit from the problem lines in that commit, we can see:

    if ( $queue_count > 1 ) {
        Menu->child( new => title => loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' );
    } elsif ( $queue_id ) {
        Menu->child( new => title => loc('New ticket'), path => '/SelfService/Create.html?Queue=' . $queue_id );
    }

Now in 5.0.0’s lib/RT/Interface/Web/MenuBuilder.pm the equivalent lines to those are:

    if ( $queue_count > 1 ) {
        $home->child( new => title => loc('Create Ticket'), path => '/SelfService/CreateTicketInQueue.html' );
    } elsif ( $queue_id ) {
        $home->child( new => title => loc('Create Ticket'), path => '/SelfService/Create.html?Queue=' . $queue_id );
    }

So what I’m now wondering is if the naughty broken code in lib/RT/Interface/Web/MenuBuilder.pm should actually read:

        if ($home->child("new")) {
            my $actions = $page->child("actions", title => loc("Actions"));
            $actions->child("create-linked-ticket", title => loc("Create linked ticket"), path => "/SelfService/Asset/CreateLinkedTicket.html?Asset=$id");
        }

Not sure, and we don’t use assets here, so this is an “exercise for the reader” (as my maths master used to like to say when we reached a sticky bit in a calculation!).