Needs review
Project:
Table of Contents
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
13 Aug 2011 at 07:57 UTC
Updated:
27 Nov 2012 at 14:28 UTC
Jump to comment: Most recent file
I have this error when adding [toc] to a page. [toc] is never replaced by the expected outpout (I have activated the needed filter in the used text format)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | tableofcontents_recoverable_error_1248204_12.patch | 704 bytes | davidneedham |
| #10 | tableofcontents_object_error.patch | 779 bytes | joel_osc |
| #3 | backtrace.txt | 7.14 KB | gagarine |
Comments
Comment #1
paulinedupraz commentedA get the same issue when I restore the database with backup and migrate.
Comment #2
mdm commentedI'm not able to reproduce the error, although I can see when using the text filter to enable TOC, it seems to have no effect. Could you please provide the [toc...] tag you're using in your content and the line number, if one appears, included in the error message? Thanks.
Comment #3
gagarine commentedI don't use the [toc tag but only the block. I had the filter to create the id on title and I think it's what is going wrong.
The problem is that _tableofcontents_replace_toc receive the format a full object (but is not the case when he came from the node_view).
Attached the backtrace when I clear the cache (without the arguments, it was to big and messy)
Here my *temporary* ugly workaround
Comment #4
lyly_double0 commentedI just use [toc]. I will reinstall it in order to find the line number
Comment #5
lyly_double0 commentedThe error comes from line 636 of file tableofcontents.pages.inc
Comment #6
ciberconta commentedThat's strange, I have the same error, but it only appears the first time that you visit website. Then, it disappears. Next day, it occurs again.
Note: I use the block.
Comment #7
michellezeedru commentedI am seeing this error as well. Always on the homepage, and sporadically on other pages. I am using TOC block. Appreciate any suggested workarounds or solutions. #3 gagarine - where did you put this code?
EDIT: I realize where gagarine added the fix in #3 (tableofcontents.pages.inc line 623). This seemed to resolve the error for me. Thanks!
Comment #8
pbfleetwood commentedSimply enabling the module causes this error on my site.
Comment #9
vacilando commentedSame problem. Appears on node save. No TOC shown at all.
(No special settings. I need it to produce TOC automatically if the number of tags is high enough.)
EDIT: @gagarine's fix from #3 removes the error but the TOC still does not show, neither in automatic mode nor with the [toc] tag (I am using a page, not a block).
Comment #10
joel_osc commentedI think I have tracked it down, basically the function _tableofcontents_process is called in tableofcontents.module on link 231 and in the tableofcontents_block.module at line 33. The first calls it like:
$text = _tableofcontents_process($node->content['body'][0]['#markup'], $format);where $format is an object and the second calls it with the string 'block':
$text = _tableofcontents_process(drupal_render($text['body']), 'block');So to me the fix is to change line 231 of the tableofcontents.module to pass in $format->format. Patch file is attached.
Comment #11
foripepe commentedDuplications:
http://drupal.org/node/1441854
http://drupal.org/node/1660150
My patch. Needs review.
Comment #12
davidneedham#11 worked for me. Here's a .patch file for what was in the code tags for convenience.
Comment #13
md2 commented#11 worked for me
Comment #14
xaa commented#11 works. thx
Comment #15
rfehren commentedThis bug is still present in the Nov. 15 release. Please include the fix from #11 in the next release.