#637 - PHP error when inserting a Table of Contents in a CEDI page
| Identifier | #637 |
|---|---|
| Issue type | Feature request or suggestion |
| Title | PHP error when inserting a Table of Contents in a CEDI page |
| Status | Completed |
| Handling member | PDStig |
| Addon | wiki |
| Description | I get the error below when I insert a Table of Contents into a CEDI page and then click preview. I am using 8.1.1 with several of the patches released after that version was issued. |
| Steps to reproduce | |
| Additional information | An error has occurred
PHP NOTICE [8] Undefined offset: -1 in sources/comcode_renderer.php on line 2447 (version: 8.1.1, PHP version: 5.3.13, URL: /data/preview.php?page=cms_cedi&type=edit_page) Here is the stack trace: Below is a stack trace revealing the state the software was in when the error occurred. If this represents a bug in the unmodified software, you may want to check Composr website for a fix, and if there isn't one, report this as a bug. Please note that merely posting a stack trace is not sufficient for us to solve your problem; the stack trace is just an aid that presents us with additional information. We still need to know the error message, what you tried to do, how you tried to do it, version numbers, and any other appropriate information. We apologise for this problem and if it's a bug we hope you will work with us so that we can fix it for you promptly. File '/home/seeingsh/public_html/bawiki.com/sources/failure.php' Line '684' Function 'get_html_trace' Args File '/home/seeingsh/public_html/bawiki.com/sources/global2.php' Line '983' Function '_fatal_exit' Args 'PHP NOTICE [8] Undefined offset: -1 in sources/comcode_renderer.php on line 2447' File '/home/seeingsh/public_html/bawiki.com/sources/failure.php' Line '217' Function 'fatal_exit' Args 'PHP NOTICE [8] Undefined offset: -1 in sources/comcode_renderer.php on line 2447' File '/home/seeingsh/public_html/bawiki.com/sources/global2.php' Line '857' Function '_Composr_error_handler' Args 'notice' 8 'Undefined offset: -1' 'sources/comcode_renderer.php' 2447 File '/home/seeingsh/public_html/bawiki.com/sources/comcode_renderer.php' Line '2,447' Function 'Composr_error_handler' Args ... File '/home/seeingsh/public_html/bawiki.com/sources/comcode_text.php' Line '1,365' Function '_do_tags_comcode' Args ... false false false NULL NULL false false File '/home/seeingsh/public_html/bawiki.com/sources/comcode_renderer.php' Line '202' Function 'comcode_text_to_tempcode' Args ... false false false false false NULL NULL File '/home/seeingsh/public_html/bawiki.com/sources/comcode.php' Line '189' Function '_comcode_to_tempcode' Args ... false false false false false NULL NULL File '/home/seeingsh/public_html/bawiki.com/sources/attachments2.php' Line '329' Function 'comcode_to_tempcode' Args ... false false false false false NULL NULL File '/home/seeingsh/public_html/bawiki.com/sources/preview.php' Line '251' Function 'do_comcode_attachments' Args ... File '/home/seeingsh/public_html/bawiki.com/sources/misc_scripts.php' Line '164' Function 'build_preview' Args true File '/home/seeingsh/public_html/bawiki.com/data/preview.php' Line '49' Function 'preview_script' Args |
| Funded? | No |
| Commits |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
If you do something like...
[contents][/contents]
[title="4"]title 4[/title]
[title="3"]title 3[/title]
Composr will get confused. When it gets to the second title ("title 3", said to be level 3) it is trying to close off a difference in level that was never opened up, so creates a stack underflow error.
Also there's another separated bug. If the WYSIWYG editor is used it throws out information needed to look at heading levels. Preserve Comcode 'title' tags if WYSIWYG is in use and a 'contents' tag has been placed already. (this means you should place a contents tag before you define a heading hierarchy)