views:

178

answers:

1
    //CODE
    $entries = $model->fetchEntries();

    $feedUri = '/rss/';
    //link from which feed is available
    $link = 'http://' . $_SERVER['HTTP_HOST'] . $feedUri;


    $feedArray = array(
            'title' => 'Student\'s Movie Club - Upcoming Movies',
            'link' => $link,
            'description' => 'Upcoming Movies',
            'language' => 'en-us',
            'charset' => 'utf-8',
            'pubDate' => $entries[0]['created'],
            'generator' => 'Zend Framework Zend_Feed',
            'entries' => array()
        );

    foreach ($entries as $movie) {
        $feedArray['entries'][] = array(
            'title' => $movie['movie_title'],
            'link' => '/movie/view/id/'.$movie['id'],
            'description' => $move['movie_review'],
            'pubDate' => $movie['created'],
            'guid' => 'http://' . $_SERVER['HTTP_HOST'] .'/movie/view/id/'.$movie['id']
             );
        }

    //var_dump($feedArray);
    //die();
    $feed = Zend_Feed::importArray($feedArray, 'rss');
    $feed->send();
    //~CODE

There is an exception thrown with this message:

An error occurred Application error Exception information:

Message: description key is missing

Stack trace:

0 C:\wwwroot\projects\studyhood\project2\library\Zend\Feed\Builder.php(182): Zend_Feed_Builder->_createEntries(Array) #1 C:\wwwroot\projects\studyhood\project2\library\Zend\Feed.php(385):

Any help appreciated...

+2  A: 

I believe this is your problem:

'description' => $move['movie_review'],

Look at the speling of $movie :) Change your code to this:

foreach ($entries as $movie) {
        $feedArray['entries'][] = array(
            'title' => $movie['movie_title'],
            'link' => '/movie/view/id/'.$movie['id'],
            'description' => $movie['movie_review'],
            'pubDate' => $movie['created'],
            'guid' => 'http://' . $_SERVER['HTTP_HOST'] .'/movie/view/id/'.$movie['id']
             );
}
karim79
thanks mate...There is another thing i found out..maybe i am wrong maybe not. IF YOU HAVE NULL VALUES IN THE DATABASE (e.g. the $movie['movie_review'] IS_NULL then you will have the same problem..Cheers.
andreas