warning: Invalid argument supplied for foreach() in .../sites/all/modules/tableofcontents/tableofcontents.pages.inc on line 685.

iva2k - July 24, 2009 - 05:48
Project:Table of Contents
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

warning: Invalid argument supplied for foreach() in .../sites/all/modules/tableofcontents/tableofcontents.pages.inc on line 685.

Inspecting the code:

  if (!empty($toc->files)) {
    $has_files = FALSE;
    $files_output .= '<li><a href="#attachments">' . t("Attachments") . "</a>";
    $files_output .= "<" . $toc->list . ">";
    foreach($files as $file) {
    ....

Should not the foreach be $toc->files?

    foreach($toc->files as $file) {

#1

iva2k - July 24, 2009 - 05:52

I tried the proposed fix above - it seems to remove the problem. Also, the attachments appeared in the table of contents.

#2

AlexisWilke - July 24, 2009 - 05:58
Status:active» fixed

iva2k,

Yes. You go the fix right. I checked it in.

Thank you.
Alexis Wilke

#3

System Message - August 7, 2009 - 06:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.