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

not getting listings after adding steps from 'extending display' and getting null on listing in list_item.php

I was following along to the ending of 'extending the display' and I added

<?php
        foreach ($directory->getStatuses() as $status) {
            echo '<option value="' . $status . '"';
            if ($status == $listing->getStatus()) echo ' selected';
            echo '>' . ucwords($status) . '</option>';
        }
        ?>

to form_listing.php and

switch($listing->getStatus()) {
    case 'premium':
        echo 'panel-info';
        break;
    default:
        echo 'panel-default';
}

to list_item.php once complete I had the tabs but the data disappeared.. in my error console it says in list_item.php

 'Uncaught Error: call to member function getStatus() on null'

I was wondering if anyone could help me with this I am not sure where I went wrong? my snapshot is snapshot

any advice would be greatly thanked!