Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Drupal Basics Writing Modules Hooks

Oliver Sewell
Oliver Sewell
16,425 Points

The hello and goodbye friend is still appearing in the navigation items when i have used 'type' => MENU_CALLBACK,

<?php

function greeting_menu() {
    $items = array();
    $items['hello_friend'] = array(
            'title' => "Hello Friend!",
            'page callback' => 'say_hello',
            'access callback' => TRUE,
            'type' => MENU_CALLBACK,
    );
    $items['goodbye'] = array(
        'title' => 'Goodbye Friend!',
        'page callback' => 'say_goodbye',
        'access callback' => TRUE,
        'type' => MENU_CALLBACK,
    );
    return $items;
}

function say_hello() {
    return '<p>Hello my dear friend!</p>';
}

function say_goodbye() {
    return '<p> Goodbye my dear friend </p>';
}

function greeting_user_login() {
    $_GET['destination'] = 'hello_friend';
}

function greeting_user_logout() {
    $_GET['destination'] = 'goodbye';

}

1 Answer

Keith Doyle
Keith Doyle
25,973 Points

I had the same issue until I disabled and then re-enabled the Greetings module, even after clearing all the caches.