Loading...
 
Skip to main content

Headings in included pages end collapsible sections in parent page

Status
Open
Subject
Headings in included pages end collapsible sections in parent page
Category
  • Regression
Feature
Wiki Syntax (text area, parser, external wiki, etc)
Resolution status
New
Submitted by
Philippe Cloutier
Lastmod by
Philippe Cloutier
Rating
(0)
Description

Since Tiki 19, a collapsible section (generated with a heading that starts with a minus or plus sign, as documented) effectively ends at the first heading of the same level or above in the pages it includes (with the INCLUDE plugin).

For example, if page Parent has
this code
Copy to clipboard
!Section 1 Direct content !+Collapsed section Direct content {include page="Help"} ! Last section Direct content

...while page Help has
the following source
Copy to clipboard
!For Support Please Contact support@company.com (555) 123-4567

...then the "For Support Please Contact" section always shows, regardless of the toggle control's state. Clicking on "+" only reveals "Direct content".


I am categorizing this ticket in Bug::Regression because this is a regression, but this is arguably not a bug.

This issue is a regression from r66644 and therefore affects Tiki 19. That commit essentially reverted r48937 (2013-12-03, on the Tiki 12 branch), so Tiki 11 and before also have the same issue.

Note that this is the second back-and-forth on this, after r29321 was reverted by r33993.

Solution

Tiki never had any code to deal with this issue. Versions 12 to 18 were not affected by chance. Relevant code is in parse_data_process_maketoc(),

around line 2598
Copy to clipboard
$aclose = '<a id="flipper' . $thisid . '" class="link" href="#" onclick="flipWithSign(\'' . $thisid . '\');return false;">[' . ($divstate == '-' ? '+' : '-') . ']</a>'; $aclose2 = '<div id="' . $thisid . '" class="showhide_heading" style="display:' . ($divstate == '+' ? 'block' : 'none') . ';">'; $headerlib = TikiLib::lib('header'); $headerlib->add_jq_onready("setheadingstate('$thisid');"); array_unshift($divdepth, $hdrlevel);
and then
around line 2568
Copy to clipboard
// Close lower level divs if opened for (; current($divdepth) >= $hdrlevel; array_shift($divdepth)) { $data .= '</div>'; }
Workaround
Enabling the INCLUDE plugin's parse_included_page parameter avoids this issue.
Importance
3
Easy to solve?
1 difficult
Priority
3
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
6992
Created
Tuesday 08 January, 2019 20:03:11 UTC
by Philippe Cloutier
LastModif
Friday 11 January, 2019 17:44:54 UTC


Show PHP error messages