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) {

Comments

iva2k’s picture

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

AlexisWilke’s picture

Status: Active » Fixed

iva2k,

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

Thank you.
Alexis Wilke

Status: Fixed » Closed (fixed)

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