Getting wrong output after implemented `theme_item_list` I have Drupal version 7.41 and I am using xubuntu 14.04 as my OS.

I have a module that displays footer links as a list. The module will fetch available links from the database and show them in individual blocks. Here is my fetch function:

function footer_links_footerblock_contents($variables) {
switch ($variables) {
    case 'group_1':
        $query = db_select('footer_links', 'fl')
                -&gt;fields('fl', array('name'))
                -&gt;condition('fl.group', 1);
        break;
    case 'group_2':
        $query = db_select('footer_links', 'fl')
                -&gt;fields('fl', array('name'))
                -&gt;condition('fl.group', 2);
        break;
    case 'group_3':
        $query = db_select('footer_links', 'fl')
                -&gt;fields('fl', array('name'))
                -&gt;condition('fl.group', 3);
        break;
    case 'group_4':
        $query = db_select('footer_links', 'fl')
                -&gt;fields('fl', array('name'))
                -&gt;condition('fl.group', 4);
        break;
    case 'group_5':
        $query = db_select('footer_links', 'fl')
                -&gt;fields('fl', array('name'))
                -&gt;condition('fl.group', 5);
        break;
}

return $query-&gt;execute();
}


The result array produced from the $query-&gt;execute(); will be going to my module's block_view function:

function footer_links_block_view($delta = '') {
switch ($delta) {
    case 'group_1':
        $block['subject'] = t('Footer Group 1');
        if (user_access('access content')) {
            $result = footer_links_footerblock_contents($delta);
            $items = array();
            foreach($result as $node) {
                $items[] = $node-&gt;name;
            }
            if (!empty($items)) {
                $block['content'] = theme('item_list', $items);
            }
            else {
                $block['content'] = t('');
            }
        }
        break;
    case 'group_2':
        $block['subject'] = t('Footer Group 2');
        if (user_access('access content')) {
            $result = footer_links_footerblock_contents($delta);
            $items = array();
            foreach($result as $node) {
                $items[] = $node-&gt;name;
            }
            if (!empty($items)) {
                $block['content'] = theme('item_list', $items);
            }
            else {
                $block['content'] = t('');
            }
        }
        break;
    }
    return $block;
}


In there I used the theme function theme('item_list', $var) to display them as a list. I have overridden the theme function like this in my template.php file:

function mytheme_item_list($variables) {
$output = '&lt;div class="col-lg-2"&gt;';
$output .= '&lt;ul class="list-unstyled"&gt;';

foreach ($variables as $member) {
    $output .= '&lt;li&gt;&lt;a href="#"&gt;' . $member . '&lt;/a&gt;&lt;/li&gt;';
}

$output .= '&lt;/ul&gt;&lt;/div&gt;'; return $output;
}


And here is my problem. When I looked at the output in the footer section, I see list items that are not even in my database in which I fetch. I see 'Array', 'ul', 'item_list' extra added list items. What is the source of this extra output? Am I not properly overriding the theme function?
Your code is wrong, since the items to render are in $variables['items'] not $variables as evident in theme_list_items().

function theme_item_list($variables) {
  $items = $variables['items'];
  $title = $variables['title'];
  $type = $variables['type'];
  $attributes = $variables['attributes'];

  // Omissis
}


You are confusing what the theme function gets in Drupal 7 with what the same theme function gets in Drupal 6. 

In general, in Drupal 7 what the theme functions need to render is always an index of the array $variables passed them; they never use $variables directly like your code does.

function theme_table($variables) {
  $header = $variables['header'];
  $rows = $variables['rows'];
  $attributes = $variables['attributes'];
  $caption = $variables['caption'];
  $colgroups = $variables['colgroups'];
  $sticky = $variables['sticky'];
  $empty = $variables['empty'];

  // Add sticky headers, if applicable.
  if (count($header) &amp;&amp; $sticky) {
    drupal_add_js('misc/tableheader.js');
    // Add 'sticky-enabled' class to the table to identify it for JS.
    // This is needed to target tables constructed by this function.
    $attributes['class'][] = 'sticky-enabled';
  }

  $output = '&lt;table' . drupal_attributes($attributes) . "&gt;\n";

  if (isset($caption)) {
    $output .= '&lt;caption&gt;' . $caption . "&lt;/caption&gt;\n";
  }

  // Omissis
}