easy-template-x icon indicating copy to clipboard operation
easy-template-x copied to clipboard

Node has no parent (two loops in the same table row)

Open apostols1 opened this issue 3 years ago • 4 comments

I followed your guide for adding a list of links in the template from here https://github.com/alonrbar/easy-template-x/issues/78

Here is the data:

image

Before the opening [ bracket there is links: [... its just not shown in the console.

image

and the template

image

With the #links part in the template its throwing node has no parent

image

Without it it renders just fine.

Here is the word template word_cv_template.docx

apostols1 avatar Mar 23 '23 12:03 apostols1

Bug confirmed and needs some investigation. Thank you for reporting this.

alonrbar avatar Apr 01 '23 19:04 alonrbar

Seems like the issue happens when there are two loops in the same table row:

two loops

A temporary workaround may be to put each of these loops in an inner table with just a single cell.

alonrbar avatar Apr 01 '23 20:04 alonrbar

I have a similar issue, but with conditions within a table : for example : template-3 docx  -  Mode de compatibilité - Word

this throws the "Node has no parent" error.

However, it is worth mensioning that I have no problem with nested loops : template-3 docx  -  Mode de compatibilité - Word_2

melbarra88 avatar Apr 02 '23 10:04 melbarra88

The latter impacts me as well, and applies to list items as well as tables. Clearly this runs deep in the code — the code is not dealing with calling loops/conditions twice on the same node in the Word structure. But @melbarra88 ’s issue means no multiple choice options in rendering of tables or lists, and that choices have to be made JSON-side rather than template-side. That's a design choice consistent with the original design, but it is locking out a lot of logic from the template.

Is this related to the long-running nested loop issue from #50 ?

opoudjis avatar Aug 17 '23 04:08 opoudjis

Fixed in v4.0.0

alonrbar avatar Jul 07 '24 09:07 alonrbar