1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed RSS Feed Error

Discussion in 'Resolved Bug Reports' started by jadmperry, Feb 14, 2011.

  1. jadmperry

    jadmperry Well-Known Member

    I have just started to try to use feeds. I have set three different feeds and they throw up errors and I don't get a feed show up in the destination forum.

    Here is the error:

    1. XenForo_Application::handlePhpError()inXenForo/Model/Feed.phpat line317
    2. XenForo_Model_Feed->_getAuthorNamesFromArray()inXenForo/Model/Feed.phpat line254
    3. XenForo_Model_Feed->prepareFeedEntry()inXenForo/Model/Feed.phpat line235
    4. XenForo_Model_Feed->prepareFeedData()inXenForo/Model/Feed.phpat line494
    5. XenForo_Model_Feed->importFeedData()inXenForo/ControllerAdmin/Feed.phpat line163
    6. XenForo_ControllerAdmin_Feed->actionImport()inXenForo/FrontController.phpat line310
    7. XenForo_FrontController->dispatch()inXenForo/FrontController.phpat line132
    8. XenForo_FrontController->run()in/home/content/32/6838832/html/Xenforo/admin.phpat line13
    Ideas?
     
  2. jadmperry

    jadmperry Well-Known Member

    Wait a minute...It may be the feeds themselves. I was importing from a government website for all three feeds, I just added a new feed from another site, worked a charm.
     
  3. Floris

    Floris Guest

    I imported from xenforo board into xenforo .. {content} stayed empty.
     
  4. Mike

    Mike XenForo Developer Staff Member

    Unfortunately, that's skipped the actual error - it comes before the backtrace that you've included. Also, we need to know the feed.
     
  5. jadmperry

    jadmperry Well-Known Member

    Mike,

    Thanks for taking a look. Here is the error message:

    Server Error

    Undefined index: name
    1. XenForo_Application::handlePhpError()inXenForo/Model/Feed.phpat line317
    2. XenForo_Model_Feed->_getAuthorNamesFromArray()inXenForo/Model/Feed.phpat line254
    3. XenForo_Model_Feed->prepareFeedEntry()inXenForo/Model/Feed.phpat line235
    4. XenForo_Model_Feed->prepareFeedData()inXenForo/Model/Feed.phpat line494
    5. XenForo_Model_Feed->importFeedData()inXenForo/ControllerAdmin/Feed.phpat line163
    6. XenForo_ControllerAdmin_Feed->actionImport()inXenForo/FrontController.phpat line310
    7. XenForo_FrontController->dispatch()inXenForo/FrontController.phpat line132
    8. XenForo_FrontController->run()in/home/content/32/6838832/html/Xenforo/admin.phpat line13
    Here is the feed: http://www.gibill.va.gov/rss/feeds/general.xml

     
  6. Kier

    Kier XenForo Developer Staff Member

    I've fixed this now.

    The error was that the feed does not expose author name, only author email. I have adjusted XenForo_Model_Feed::_getAuthorNamesFromArray() accordingly to use name first, email alternatively or else to not populate the data.
     
  7. Kier

    Kier XenForo Developer Staff Member

    PHP:
        /**

         * Attempts to convert a Zend_Feed_Reader_Collection_Author object
         * into a comma-separated list of names.
         *
         * @param Zend_Feed_Reader_Collection_Author|null $feedAuthors
         *
         * @return string
         */
        
    protected function _getAuthorNamesFromArray($feedAuthors)
        {
            
    $authorNames = array();

            if (
    $feedAuthors)
            {
                foreach (
    $feedAuthors AS $author)
                {
                    if (isset(
    $author['name']))
                    {
                        
    $authorNames[] = $author['name'];
                    }
                    else if (isset(
    $author['email']))
                    {
                        
    $authorNames[] = $author['email'];
                    }
                }
            }

            return 
    implode(', '$authorNames);
        }
     

Share This Page