Invenzzia »

IMPORTANT ANNOUNCEMENT

Due to the uncertain status of the Flyspray project, lack of new releases and moving the code repository to Github, we decided to shutdown this issue tracker by the end of January 2011. From that date, the bugs should be reported directly in Github project repositories.

List of repositories:

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
Tasklist

FS#61 - opt:extend and opt:snippet order

Attached to Project: Open Power Template
Opened by Skruppy (Skrupellos) - Friday, 06 March 2009, 07:50 GMT-7
Last edited by Zyx (Zyx) - Saturday, 07 March 2009, 02:08 GMT-7
Task Type Bug Report
Category Compiler
Status Closed
Assigned To No-one
Operating System OS-independent
Severity Medium
Priority Normal
Reported Version 2.0 SVN
Due in Version 2.0-beta3
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

EXAMPLE:
Render the b.tpl with the following content.
--- code (a.tpl) ---
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:root>
<opt:insert snippet="A" />
<opt:insert snippet="B" />
<opt:insert snippet="C" />
</opt:root>
--- END code ---

--- code (b.tpl) ---
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:extend file="a.tpl">
<opt:snippet name="C">C</opt:snippet>
<opt:snippet name="A">A</opt:snippet>
<opt:snippet name="B">B</opt:snippet>
</opt:extend>
--- END code ---


RESULT:
--- output ---
AC
--- END output ---


EXPECTED:
--- output ---
ABC
--- END output ---


DESCRIPTION:
If I change anything in this constellation, I get the expected output. So a simple workaround is to change the order in "b.tpl"
This task depends upon

Closed by  Zyx (Zyx)
Saturday, 07 March 2009, 02:08 GMT-7
Reason for closing:  Fixed
Additional comments about closing:  Fixed in rev. 62
Comment by Skruppy (Skrupellos) - Friday, 06 March 2009, 08:58 GMT-7
As an addition, I think this problem came up as I updated to the newest SVN version of Opt.
Comment by Zyx (Zyx) - Friday, 06 March 2009, 23:57 GMT-7
Strange - I can't remember whether I modified the snippet code. The unit tests also showed nothing worrying, however - I'll check it.
Comment by Zyx (Zyx) - Saturday, 07 March 2009, 01:26 GMT-7
OK, the problem was caused by the buggy implementation of Opt_Xml_Scannable::removeChild() method that in some cases did not notice that the node requested to be removed exists in the children list and returned that nothing was removed. In case of snippets, the removal was necessary to remove the snippets from the template tree, because it is disposed once it was processed.

If such situation occured, the snippet was still linked to the tree and their contents were disposed before it was inserted somewhere. However, the snippet instruction still held a reference to the appropriate opt:snippet node, so the missing snippet was not reported, because formally - it was still present (but without its content).

Loading...